Subject: Re: On KeyDown Bug

Robert Sneidar bobs at twft.com
Mon Mar 27 12:11:08 EST 2006


I think you missed the point. I DO want the case statement to  
progress without breaks because I want the variable theModifier to be  
ALL of the modifier keys that are being pressed on keyDown. As I  
understand it, case statements without breaks will do that. And it  
still doesn't explain how I can end up with a Ctrl in theModifier  
when only the shift key was being held down.

If anyone would please feel free to paste my snippet (previously  
posted) into a stack and observe what happens, I'd be curious if it  
were just me. I am after all going through a KVM switch and a USB hub.

Bob

> WAIT. don't send a bug report yet...how is it working at all?
>
> don't forget the BREAK statement in your SWITCH structure...
>
> on keyDown theKey
>    local theModifier
>    put "" into theModifier
>    switch
>    case the optionKey is down
>      put "Opt " after theModifier
>      break -- <----------
>    case the CommandKey is down
>      put "Cmd " after theModifier
>      break -- <----------
>    case the shiftKey is down
>      put "Shft " after theModifier
>      break -- <----------
>    case the controlKey is down
>      put "Ctrl " after theModifier
>      break -- <----------
>    end switch
>    put char 1 to -1 of theModifier into theModifier
>    replace " " with "-" in theModifier
>    put theModifier && theKey
>    pass keyDown
> end keyDown
>
> Bob Sneidar
> IT Manager
> Logos Management
> Calvary Chapel CM
>



More information about the use-livecode mailing list