controlkeydown
Sarah Reichelt
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.
e.g.
on controlKeyDown pKey
if pKey = "T" then
-- do T stuff
else if pKey = "F" then
-- do F stuff
else
pass controlKeyDown
-- allow any other keys to function normally
end if
end controlKeyDown
As others have suggested, if you want to check for lots of keys, a switch
will be more efficient.
Cheers,
Sarah
> 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?
>
> Pierre
>
>>
>> Pierre
>>
>> Get rid of the quotes, thus:
>> on controlKeyDown T
>> DoSomething
>> 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.
>>
>> regards
>> David
>>
>> 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"
>>> DoSomeThing
>>> end controlkeydown
>>>
>>> There is no reaction. What is wrong in my handler?
>>>
>>>
>>> Thanks
>>>
>>> Pïerre
>>> _______________________________________________
>>> use-revolution mailing list
>>> use-revolution at lists.runrev.com
>>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>>
>>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
More information about the use-livecode
mailing list