Home UserCP Memberlist Register Calendar FAQ
Home


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

Reply
 
LinkBack Thread Tools Display Modes
Key programming question
Old 07-14-2006, 04:36 PM   #1 (permalink)
Dealer
 
Join Date: Jul 2006
Location: North Las Vegas
Posts: 227
Vegas is on a distinguished road
Default Key programming question

Ok, so let's say I want to send a numpad left arrow followed by a numpad down arrow. If I use TB to see what these keys generate when I physically press them, I get the following:

(VK_LEFT->0X25)
LEFT (Ext)

(VK_DOWN->0X28)
DOWN (Ext)

So can someone give me an example of how that would look typed in, in TB toolkit? I tried looking at a couple profiles, and some seem to be slightly different in how they are entered? Like some have { } around them, some don't... does this make a diff? Also, say I wanted to introduce a slight pause (maybe 1/2 second) between keypress one, and keypress two, what would that look like? I'd just like confirmation that I'm on the right track. Thanks a bunch!

Last edited by Vegas; 07-14-2006 at 04:45 PM.
Vegas is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-14-2006, 04:56 PM   #2 (permalink)
 
Wild.Bill.Kelso's Avatar
Toolkit Creator
 
Join Date: May 2006
Location: Cincinnati, Ohio
Posts: 2,174
Wild.Bill.Kelso is on a distinguished road
Default

I'm no expert, but here goes:

Code:
macro = predef:LEFT
macro = predef:DOWN
That is using the new Predefinded keys Zorlac has included in his TB 1.0.1 version. So, hope you have that version.

The Sendkeys syntax is the way that uses the { } braces. Sendkeys is good for most normal key combinations like A-Z(a-z); 0-9 (top of keyboard); F1 - F12, ect... Just look in the Sendkeys help file. It is not good to use it for Numpad keys.

For Numpad keys, try to use Zorlac's new Predefinded keys. The Numpad keys just work weird, so you have to use a different method to get them to work. Zorlac first added the RawKeys syntax to handle these. But has made it simpiler for use by creating his own Predefined syntax that sends the RawKey equivilantes for us.

Hope this helps.
__________________
(a.k.a. Snacko)
Touchscreen: Innovatek TM-868 8"; Running Local Mode on XP Pro


Wild.Bill.Kelso is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-14-2006, 05:38 PM   #3 (permalink)
Dealer
 
Join Date: Jul 2006
Location: North Las Vegas
Posts: 227
Vegas is on a distinguished road
Default

No joy with the predef. I'm trying to make a Falcon profile and it has substantial use of the numpad, unfortunately.

Update:

Ok, trying the rawkey mode, this seems to work:

macro = rawkey: LEFT, EXTENDED KEY
macro = rawkey: LEFT, EXTENDED KEY | KEYUP
macro = rawkey: DOWN, EXTENDED KEY
macro = rawkey: DOWN, EXTENDED KEY | KEYUP


Just asking for opinions here, but is this about as clean a code as possible for this? Also, when I open TB it always opens in the upper left corner, and then when I hit "let's go" the window appears in the same spot. So I have to drag it every time. Is there a way to make TB start in the touchscreen?

Last edited by Vegas; 07-14-2006 at 06:07 PM.
Vegas is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-14-2006, 09:22 PM   #4 (permalink)
Creator
 
Join Date: May 2006
Location: Cambridge, UK
Posts: 1,623
zorlac is on a distinguished road
Default

What version of TouchBuddy are you using?

If you need a delay, just add this wherever you need it in the macro list:

macros = {PAUSE xxx}

(where xxx is the number of milliseconds to wait)

The initial TB window is currently hardcoded to start on primary screen (will add a fix for this to next version), but the profile window can be opened wherever you like by editing the [new-window] section of that profile.
__________________


(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 07-14-2006, 09:31 PM   #5 (permalink)
Dealer
 
Join Date: Jul 2006
Location: North Las Vegas
Posts: 227
Vegas is on a distinguished road
Default

Using the latest touchbuddy software and toolkit. I tried a different keystroke (Shift + G) w/ predef and it works fine. Maybe the numpad is giving it problems or maybe I typed it in wrong? Dunno...

Thanks for the info on the pause.
Vegas is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-15-2006, 10:15 AM   #6 (permalink)
Creator
 
Join Date: May 2006
Location: Cambridge, UK
Posts: 1,623
zorlac is on a distinguished road
Default

I know this is gonna be an odd question, but can you try it with NumLock off (or "on" if its already off). Just press the Numlock button to toggle it to the other setting ("On to Off", or "Off to On"). Then press the keys you want to see what values you get.

Ah... just noticed... you are not after LEFT and DOWN cursor keys, are you.... you are after the cursor keys on the number pad. Once I have sorted my office out, i`ll fire up my game rig and see about thse damn annoying numpad keys
__________________


(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 07-15-2006, 11:29 AM   #7 (permalink)
Creator
 
Join Date: May 2006
Location: Cambridge, UK
Posts: 1,623
zorlac is on a distinguished road
Default

Well, the NumLock status affects which keys the system see when you press a key on the number pad. Try it yourself:

Fire up TB, Select Client mode, load a config, and Lets Go.

Check the status of your NumLock light.

Press the Number "4" key on the number pad. If NumLock is on, the system sees "NUMPAD4". If NumLock is off, the system sees VK_LEFT or LEFT.

Does Falcon work on this keypress with and without NumLock enabled? Just curios.
__________________


(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 07-15-2006, 11:38 AM   #8 (permalink)
Creator
 
Join Date: May 2006
Location: Cambridge, UK
Posts: 1,623
zorlac is on a distinguished road
Default

Right just installed and fired up F4:AF.... it doesnt matter whether NumLock is on or off, the key still works.

Can I suggest that you try using:

Code:
macro = predef:NUMPAD4
macro = {PAUSE 2000}
macro = predef:NUMPAD2
or

Code:
macro = rawkey: VK_NUMPAD4, EXTENDED KEY
macro = rawkey: VK_NUMPAD4, EXTENDED KEY | KEYUP
macro = {PAUSE 2000}
macro = rawkey: VK_NUMPAD2, EXTENDED KEY
macro = rawkey: VK_NUMPAD2, EXTENDED KEY | KEYUP
__________________


(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 07-15-2006, 05:41 PM   #9 (permalink)
Dealer
 
Join Date: Jul 2006
Location: North Las Vegas
Posts: 227
Vegas is on a distinguished road
Default

Zorlac, your predef listed above worked fine (and it's much cleaner than what I had). I actually dropped out the pause and it works well w/o it. I had a previous problem when I was programming something else (another controller) and needed a pause in that instance, so I thought I might here also. As far as missing the predef originally, evidently, the LEFT and RIGHT, DOWN weren't recognized by F4AF and they needed to be NUMPAD, even tho numlock doesn't have to be on when they are sent... huh??? (hope that made some sense). But w/o the numlock on when you are trying to see what keypress is generated, you can't get the correct predef. Something to file away as I bet I run into it again. Thanks for the help, I think I'm actually learning something! Who says you can't teach an old dog new tricks?
Vegas is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-15-2006, 05:44 PM   #10 (permalink)
Creator
 
Join Date: May 2006
Location: Cambridge, UK
Posts: 1,623
zorlac is on a distinguished road
Default

<phew> another success....
__________________


(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 09:08 AM.
Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0

  www.touch-buddy.com        Archive  


Footer
vBSkinworks Top