Page 1 of 1
Status of keys on keyboard
Posted: Sat Jul 21, 2007 11:46 am
by Garrett
Greetings,
There's some great functions and messages for working with the keyboard and obtaining when keys are pressed, but I'm in need of something a little more. Determining the if the capslock key is up or down is there, but can't find anything that will help me with scrolllock, numlock and insert keys.
Does anyone know if there's a way in Rev to determine the status of these keys?
The rawkeydown returns the numerical id's for these, but still no way to determine if these keys are active or not like the capslock function.
Thanks in advance,
-Garrett
Posted: Sat Jul 21, 2007 12:28 pm
by Klaus
Hi Garret,
check the docs for "rawkeydown/-up".
To get the the correct "rawkey" number of these keys, create a new stack with one field and put this into the cardscript:
Code: Select all
on rawkeydown tKey
put tKey & CR after fld 1
## or "...into fld 1"
end rawkeydown
This way cou can press any key, see its "rawkey" number and use this for your scripting.
Hope that helps.
Best from germany
Klaus
Posted: Sat Jul 21, 2007 12:29 pm
by Klaus
Ooops, sorry, totally overlooked your last sentence :-/
Sorry, no other ideas...
Posted: Sat Jul 21, 2007 1:17 pm
by Mark
Hi Garrett,
Check the keysDown function in the docs.
Best,
Mark
Posted: Sat Jul 21, 2007 1:19 pm
by Klaus
keysdown()
Exactly, took about 2 more hours before I also had this idea, but it's hard to beat this smart dutchman anyway

Posted: Sat Jul 21, 2007 10:08 pm
by Garrett
keysdown does not give me the status of the key though, merely if the key is being pressed or with keysup, if it's been released. It doesn't allow us to determine if say numlock, scrolllock or insert is active or not though.
I appreciate you guys at least looking into this for me. Thanks,
-Garrett
Posted: Sun Jul 22, 2007 1:40 am
by xApple
Yeah well if there really is no way of knowing the status of those toggle-style keys, file it as a bug.
I guess only the capslock is supported because all of the other ones have long gone on the macintosh keyboards or never existed. Thus, trying to implement them in your program will render it un-multiplatform. If you avoid using them altogether, it's better. You can surly find a better GUI way of achieving what you want.
Cheers.
Posted: Sun Jul 22, 2007 5:31 am
by Garrett
Alrighty then. Many thanks to all of you for replying and trying to help.
-Garrett