Nerves getting raw from rawKeyDown

Richmond Mathewson richmondmathewson at gmail.com
Sat Nov 28 07:47:41 EST 2009


On 11/28/09 2:40 PM, Sarah Reichelt wrote:
> On Sat, Nov 28, 2009 at 10:32 PM, Richmond Mathewson
> <richmondmathewson at gmail.com>  wrote:
>    
>> In RunRev 4
>>
>> pass rawkeydown doesn't seem to work:
>>
>> have a card script full to brimming with lots of
>>
>> case . . . break
>>
>> statements inside a rawkeydown thing, e.g:
>>
>> on rawKeyDown RAWK
>>   case RAWK = 121
>>      put "Fred Flintstone" into fld "fTEXT"
>>   break
>>
>>   pass rawKeyDown
>>
>> end rawKeyDown
>>
>> this means that everytime I click the 'Y' key
>> 'Fred Flintstone' appears in my field,
>>
>> AND . . .
>>
>> all the other keys on my keyboard are disabled!!!!!!!!!
>>
>> so; no DELETE, no ARROW keys, and nothing else.
>>
>> STINKS.
>>      
> You seem to have forgotten to put in the "switch" part, so I guess the
> "break" is stopping the handler every time.
>
> Try something like this:
>
> on rawKeyDown RAWK
>    switch RAWK
>      case 121
>        put "Fred Flintstone" into fld "fTEXT"
>        break
>      case 122
>        put "Barney" into fld "fTEXT"
>        break
>      default
>        put "Dino" into fld "fTEXT"
>    end switch
>
>    pass rawKeyDown
> end rawKeyDown
>
> Cheers,
> Sarah
>    

Bless you, fifty-thousand times;

I had the "switch" part, but had forgotten to write:

switch RAWK   (had only written  switch )

saved my life:

Look for your name "in lights" in the 1.0.2 release of my Devawriter; 
coming out in about 2 hours!

Love you buckets!!! Richmond.



More information about the use-livecode mailing list