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?
Catching a key in EVC++
Um, could you make that a bit clearer? What is the something that you want to do with the key 0x26?
I'm just going to have it change some variables when it is pressed.
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.
Oh, did you want the code? Here's a case that should do it:
case WM_KEYDOWN:
vkKey = (short)wParam;
if (vkKey == g_gxkl.vkUp) {
//stuff
break;
}
if (vkKey == g_gxkl.vkDown) {
//stuff
break;
}
case WM_KEYUP:
vkKey = (short)wParam;
if (vkKey == g_gxkl.vkUp) {
//stuff
break;
}
if (vkKey == g_gxkl.vkDown) {
//stuff
break;
}
//WM_KEYUP detects when a key is released.
//WM_KEYDOWN detects when a key is pressed.
case WM_KEYDOWN:
vkKey = (short)wParam;
if (vkKey == g_gxkl.vkUp) {
//stuff
break;
}
if (vkKey == g_gxkl.vkDown) {
//stuff
break;
}
case WM_KEYUP:
vkKey = (short)wParam;
if (vkKey == g_gxkl.vkUp) {
//stuff
break;
}
if (vkKey == g_gxkl.vkDown) {
//stuff
break;
}
//WM_KEYUP detects when a key is released.
//WM_KEYDOWN detects when a key is pressed.
Doh, I always forget the includes and defines:
#include "gx.h"
GXKeyList g_gxkl; // GX struct
#define WM_KEYDOWN 0x28
#define WM_KEYUP 0x26
#include "gx.h"
GXKeyList g_gxkl; // GX struct
#define WM_KEYDOWN 0x28
#define WM_KEYUP 0x26
thats why he's asking moose, the jornadas have no d-pad.
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.