optionKeyDown message broken

J. Landman Gay jacque at hyperactivesw.com
Thu Apr 21 15:27:40 EDT 2022


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         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com


More information about the use-livecode mailing list