SHIFTy thoughts

Len Morgan len-morgan at crcom.net
Mon Oct 11 06:27:49 CDT 2010


  On 10/11/2010 6:16 AM, Roger.E.Eller at sealedair.com wrote:
> Richmond wroe:
>> I would love to be able to trap when a modifier key is down like this:
>>
>> on shiftKeyDown
>>      do blah, blah, blah
>> end shiftKeyDown
>>
>> but it seems that that is not possible in LievCode, unless, of course,
>> I'm missing something . . .
>>
>> Richmond.
> I can only determine its state within an if-then statement.  Perhaps try a
> rawKey handler.
>
> on mouseUp
>     if the shiftKey is down then
>        answer "DOWN, the shiftKey is."
>     else
>        answer "UP, the shiftKey is."
>     end if
> end mouseUp
>
> ~Roger
I think what Richmond was after was a message that get's sent when he 
presses the shift key, not detecting when it's down.  The only way that 
comes to mind would be a front script that captured the keydown/keyup or 
rawkeys messages, check for the shift key state then fired a message to 
a handler of your choosing.

You'd have to pass on the original event in either case and make sure 
you didn't set up some sort of infinite loop though.

len



More information about the use-livecode mailing list