So this works in a locked or unlocked field script, if you click on the field and press CMD-3:
Code: Select all
on commandkeyDown tkey
if tkey = "3" then beep 3
end commandkeyDown
But not a button, You cannot, from msg, "focus on btn 1" and then move the cursor over that button and press "CMD-3". It may have once had focus, but does not maintain it very well.
However, this works:
Code: Select all
on mouseEnter
focus on me
end mouseEnter
on commandkeyDown tkey
if tkey = "3" then beep 3
end commandkeyDown
I was intrigued by the notion of a focused button, essentially an entirely invisible property, in more ways than simply visually. Whether it is useful to be able to use messages like commandKeyDown there is another story.
Craig