On KeyDown Bug

Robert Sneidar bobs at twft.com
Sun Mar 26 22:50:24 EST 2006


Hi Everyone. This may be a bug, I do not know. Observe the following  
snippet in the script of the stack:

on keyDown theKey
   local theModifier
   put "" into theModifier
   switch
   case the optionKey is down
     put "Opt " after theModifier
   case the CommandKey is down
     put "Cmd " after theModifier
   case the shiftKey is down
     put "Shft " after theModifier
   case the controlKey is down
     put "Ctrl " after theModifier
   end switch
   put char 1 to -1 of theModifier into theModifier
   replace " " with "-" in theModifier
   put theModifier && theKey
   pass keyDown
end keyDown

This SHOULD put the modifier keys and the key typed in the result of  
the message box. It works when I just type letters. BUT when I use a  
modifier that is NOT the shift key, I get NOTHING. IF I use the Shift  
key I get "Shft-Crtl " followed by the letter typed, even though the  
Control key is NOT down!

Well this cannot be right! What is really needed is a new argument in  
the keyDown and keyUp handlers for the modifier keys. I should be  
able to write the handler this way:

on keyDown theKey, theModifiers
if "Shift" is in theModifiers then
   -- some stuff here
end if
pass keyDown
end keyDown

I guess this is a bug report AND a feature request.

Bob Sneidar
IT Manager
Logos Management
Calvary Chapel CM




More information about the use-livecode mailing list