Page 1 of 1

Catching a key in EVC++

PostPosted: Apr 3, 2001 @ 8:19am
by Jay
Ok, I have a question.  In EVC++ how do I make it so that it does something when I press the rocker up(0x26) on my Jornada?

Re: Catching a key in EVC++

PostPosted: Apr 3, 2001 @ 8:25am
by Jaybot
Um, could you make that a bit clearer?  What is the something that you want to do with the key 0x26?

Re: Catching a key in EVC++

PostPosted: Apr 3, 2001 @ 8:48am
by Jay
I'm just going to have it change some variables when it is pressed.

Re: Catching a key in EVC++

PostPosted: Apr 3, 2001 @ 9:22am
by Moose or Chuck
The rocker is the up and down key. It's identical to that and can not be coded seperate from it. So the Up and Down key on the D-Pad are duplicated by the rocker.

Re: Catching a key in EVC++

PostPosted: Apr 3, 2001 @ 9:24am
by Moose or Chuck
Oh, did you want the code? Here's a case that should do it:<br><br>               case WM_KEYDOWN:<br>                     vkKey = (short)wParam;<br>                     if (vkKey == g_gxkl.vkUp) {<br>                           //stuff<br>                           break;<br>                     }<br>                     <br>                     if (vkKey == g_gxkl.vkDown) {<br>                           //stuff<br>                           break;<br>                     }<br>                     <br>               case WM_KEYUP:<br>                     vkKey = (short)wParam;<br>                     if (vkKey == g_gxkl.vkUp) {<br>                           //stuff<br>                           break;<br>                     }<br>                     <br>                     if (vkKey == g_gxkl.vkDown) {<br>                           //stuff<br>                           break;<br>                     }<br><br>//WM_KEYUP detects when a key is released.<br>//WM_KEYDOWN detects when a key is pressed.

Re: Catching a key in EVC++

PostPosted: Apr 3, 2001 @ 9:25am
by Moose or Chuck
Doh, I always forget the includes and defines:<br><br>#include "gx.h"<br>GXKeyList g_gxkl;              // GX struct<br><br>#define WM_KEYDOWN                      0x28<br>#define WM_KEYUP                        0x26

Re: Catching a key in EVC++

PostPosted: Apr 3, 2001 @ 1:05pm
by Jaybot
thats why he's asking moose, the jornadas have no d-pad.

Re: Catching a key in EVC++

PostPosted: Apr 4, 2001 @ 2:36am
by Moose or Chuck
Well, as I said The rocker is only the up and down key, on all devices. So just use the up and down key tests I provided.