On 4/21/22 10:55 AM, Paul Dupuis via use-livecode wrote:
In a new stack, place the following in the card script:

on optionKeyDown pKeyName
   if platform() = "MacOS" then
     put numToChar(charToNum(pKeyName)-128) into tKey1 -- original sample from 
Dictionary
    put numToCodePoint(codepointToNum(pKeyName)-128) into tKey2 -- trying using non-deprecated functions
     answer pKeyName,tKey1,tKey2
   else -- windows
     answer pKeyName
   end if
end optionKeyDown

The equivalent new functions for numToChar and charToNum is numToNativeChar and nativeCharToNum. Those return the same values as the originals. However, I'm still getting the wrong result. I can subtract 94 to get lower-case "f" but that isn't consistent; the amount to subtract varies depending on the value of pKeyName. So there's some trick I'm missing.

Tested on Mac.

--
Jacqueline Landman Gay         |     jac...@hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to