Home UserCP Memberlist Register Calendar FAQ
Home


Go Back   Official TouchBuddy Forum > Support > Technical Q&A

Reply
 
LinkBack Thread Tools Display Modes
Sendkeys syntax for arrow keys
Old 08-11-2006, 01:44 AM   #1 (permalink)
Junky
 
Join Date: Jul 2006
Location: Ontario, Canada
Posts: 34
wraith is on a distinguished road
Default Sendkeys syntax for arrow keys

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?
wraith is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 08-11-2006, 08:52 AM   #2 (permalink)
Creator
 
Join Date: May 2006
Location: Cambridge, UK
Posts: 1,623
zorlac is on a distinguished road
Default

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.
zorlac is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 08-11-2006, 12:43 PM   #3 (permalink)
Junky
 
Join Date: Jul 2006
Location: Ontario, Canada
Posts: 34
wraith is on a distinguished road
Default

Thank zorlac.
How would it work if i wanted to make a combination? ie. Shift-Up Arrow or Ctrl-Up Arrow...etc.
wraith is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 08-11-2006, 12:58 PM   #4 (permalink)
Creator
 
Join Date: May 2006
Location: Cambridge, UK
Posts: 1,623
zorlac is on a distinguished road
Default

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 dont define a KEYDOWN or KEYUP events, TB assumes you want a single press and sends a DOWN then an UP event).

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
Read that carefully, and understand what it is doing. Its registering a SHIFT KEYDOWN event, then a UP KEYDOWN event, so the system will see both these keys as selected. They you have to send the KEYUP events to set it all back to normal, and its best practise to send the KEYUP events in the reverse order that they were set as KEYDOWN.

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)
zorlac is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 08-11-2006, 01:04 PM   #5 (permalink)
Junky
 
Join Date: Jul 2006
Location: Ontario, Canada
Posts: 34
wraith is on a distinguished road
Default

I get it lnow zorlac. I've never coded keystrokes before so it's a bit of a primer for me.
I'll try it later tonight and report back if I have any issues.

Thanks again for your help.
wraith is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 08-11-2006, 01:07 PM   #6 (permalink)
Creator
 
Join Date: May 2006
Location: Cambridge, UK
Posts: 1,623
zorlac is on a distinguished road
Default

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)
zorlac is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT. The time now is 10:58 AM.
Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0

  www.touch-buddy.com        Archive  


Footer
vBSkinworks Top