sarahr at genesearch.com.au
Wed Feb 20 19:50:01 EST 2002
As I understand it, when you use
on controlKeyDown T
you are using T as a variable name which will contain whatever key you have
actually pressed. You then need to check the value of your variable and see
it it matches any of the keys you want to respond to.
on controlKeyDown pKey
if pKey = "T" then
-- do T stuff
else if pKey = "F" then
-- do F stuff
-- allow any other keys to function normally
As others have suggested, if you want to check for lots of keys, a switch
will be more efficient.
> Sorry but when I use controlkeydown T (without the quotes, as you say), I
> get a result, but the result is the same whatever the key. I if press ctrl F
> or ctrl G, for example, the result is exactly the same as ctrl T!!
> So the question remains : how to use controlkeydown to get a different
> result for ctrl T or ctrl F?
>> Get rid of the quotes, thus:
>> on controlKeyDown T
>> end controlKeyDown
>> I know the Transcript Dictionary for controlKeyDown shows "keyname" but
>> I got the clue from commandKeyDown where it just says keyname, without
>> the quotes. Probably one for Jeanne's list, for consistency.
>> On Wednesday, February 20, 2002, at 09:29 , Pierre Delain wrote:
>>> I try to use the following handler to create a shortcut with the "T" :
>>> on controlkeydown "T"
>>> end controlkeydown
>>> There is no reaction. What is wrong in my handler?
>>> use-revolution mailing list
>>> use-revolution at lists.runrev.com
> use-revolution mailing list
> use-revolution at lists.runrev.com
More information about the Use-livecode