Cmd-A doesn't work from Keyboard in Standalone

Charles Hartman charles.hartman at
Fri Nov 18 08:57:49 EST 2005

On Nov 18, 2005, at 1:22 AM, Sivakatirswami 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...

But this handler may not be doing anything, if it is in the script  
for a field, because it duplicates the default behavior.

I think I have figured out for sure (?) that a commandKeyDown handler  
in the script for a field will not capture, block, or divert a cmd-A  
pressed when that field has the focus. I tried this, so as to make  
cmd-A simulate a particular button-press in a context where selecting  
all the items in a field did not make any sense.

The only way I could find is to use a rawKeyDown handler, with a test  
inside it for "if the commandKey is down", and a switch inside that.  
This means that if cmd-A is supposed to do the same thing when the  
focus is outside the field, I also need a commandKeyDown handler one  
level up, in the card or stack script, which does the same thing.

So commandKeyDown works outside the field, but only rawKeyDown works  
inside the field.

I'd really like to know if I've got something wrong about this.

Charles Hartman

More information about the Use-livecode mailing list