![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
| Sendkeys syntax for arrow keys |
|
|
#1 (permalink) |
|
Junky
Join Date: Jul 2006
Location: Ontario, Canada
Posts: 34
![]() |
I'm trying to map the Arrow keys (not the arrow keys on the number pad).
Example: I tried using macro = {LEFT} and il-2 maps it as Numpad 4. What is the corrent sendkeys for the arrow keys? |
|
|
|
|
|
#2 (permalink) |
|
Creator
Join Date: May 2006
Location: Cambridge, UK
Posts: 1,623
![]() |
ah yes, the non-alpha-numeric keys... what a pain they have been :)
macro = predef:LEFT or macro = predef:RIGHT or macro = predef:UP or macro = predef:DOWN These macros will send one single key event when triggered. If you want to be able to press and hold a button, and have the arrow keys held down while doing so, then let me know and i`ll explain how to do that too. FYI - there is a brief description on predef and rawkeys in the docs folder, the file you want to look at is called predef-and-rawkey-reference.html.
__________________
![]() ![]() (Setup: XP Pro, classic mode, LinITX 8" touchscreen (Client/Server), 19" touchscreen (Local), latest development version of TouchBuddy) Last edited by zorlac; 08-11-2006 at 08:56 AM. |
|
|
|
|
|
#4 (permalink) |
|
Creator
Join Date: May 2006
Location: Cambridge, UK
Posts: 1,623
![]() |
OK, quick overview of how key events work
Each key event comprises of a key down event and a key up event. This is how keyboards work... they register a down event when the key is pressed, and an up event when released. The system takes these events and stores their status away somewhere, so it can be interogated by applications. In the previous example for the arrow keys, they were simple: Code:
predef:LEFT, KEYDOWN predef:LEFT, KEYUP If you want to combine keys, you have to start breaking it down into exactly what it is the keys should be doing. You wanted to know how the macros would look for Shift-Up, so lets look at that. Code:
predef:SHIFT, KEYDOWN predef:UP, KEYDOWN predef:UP, KEYUP predef:SHIFT, KEYUP BEWARE - you *REALLY* have to be careful when constructing predef macros... ensure that for every KEYDOWN event, you have a corresponding KEYUP event for that same key, or the keyboard status will be left in an unknown and unpredictable state, with keys being left in the DOWN state... it can get really nasty ![]() Does that explain it a bit clearer?
__________________
![]() ![]() (Setup: XP Pro, classic mode, LinITX 8" touchscreen (Client/Server), 19" touchscreen (Local), latest development version of TouchBuddy) |
|
|
|
|
|
#6 (permalink) |
|
Creator
Join Date: May 2006
Location: Cambridge, UK
Posts: 1,623
![]() |
It was all new to me too when I started, and I had to find out the hard way
![]()
__________________
![]() ![]() (Setup: XP Pro, classic mode, LinITX 8" touchscreen (Client/Server), 19" touchscreen (Local), latest development version of TouchBuddy) |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|