I've discovered what appears to be a bug with optionKeyDown and Windows.
The following works as expected on OS X:
Code: Select all
on optionKeyDown theKey
--answer numToChar(charToNum(theKey) - 128)
answer charToNum(theKey)
if charToNum(theKey) = 182 then
set the visible of button StopAskingCheck to true
-- else
-- set the visible of button StopAskingCheck to false
end if
end optionKeyDown
What I'm doing is showing a checkbox on my donations nag window if the user presses Alt+d. On OS X this is working as expected.
However, on Windows the event fires even when no other key is down despite the documentation saying the following:
So, on Windows theKey always equals 54 (I guess this is the value of the Alt key by itself). I've tried this in the IDE and in a built application.The optionKeyDown message is sent only when the user types a key combination that produces a character. For example, typing Option-F11 does not send an optionKeyDown message, because Option-F11 does not produce a character.
Is this a known error? Do I need to file a bug report? Suggestions for ways to code around it?