PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Catching a key in EVC++

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?
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.
Moose or Chuck · 03 Apr 2001, 08:22 UTC
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.
Moose or Chuck · 03 Apr 2001, 08:24 UTC
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.
Moose or Chuck · 03 Apr 2001, 08:25 UTC
Doh, I always forget the includes and defines:

#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.
Moose or Chuck · 04 Apr 2001, 01:36 UTC
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.