Cmd-A doesn't work from Keyboard in Standalone

Sarah Reichelt sarah.reichelt at gmail.com
Fri Nov 18 01:29:29 EST 2005


On 11/18/05, Sivakatirswami <katir at hindu.org> wrote:
> WEll you can't block it in the IDE very easily.. but I found that if
> I had  just this:
>
> on commandKeyDown theKey
>    switch theKey
>    case "a"
>      if the selectedField is not empty then
>        select text of the selectedField
>      end if
>      break
>    end switch
> end commandKeyDown
>
> then cmd-x,c,v (copy, cut, paste) were all blocked... so I suspect if
> you have a commandKeyDown theKey  handler, and no "a" case, then it
> might get blocked, at least in a standalone. but then you have to
> code them all, which I did finally.
>

A better solution is to "pass" the message if you don't use it. I
would write your handler like this:

on commandKeyDown theKey
  switch theKey
  case "a"
    if the selectedField is not empty then
      select text of the selectedField
    end if
    break
  default
    pass commandKeyDown
  end switch
end commandKeyDown

This makes it so that ANY command key shortcut that doesn't get caught
in your switch statement, will get passed up the message hierarchy for
your app or the Rev engine to process. It is generally a good idea to
"pass" all system messages if you don't use them.

Cheers,
Sarah



More information about the use-livecode mailing list