Nerves getting raw from rawKeyDown

Sarah Reichelt sarah.reichelt at gmail.com
Sat Nov 28 07:40:52 EST 2009


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



More information about the use-livecode mailing list