PocketMatrix forums

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

Windows 6.5 and GAPI

So I started looking at getting my company an account for selling games on the new App Store that MS is launching in Windows 6.5. I was looking through the document that details the submission requirements and one of them is that GAPI is being phased out completely so the calls will no longer be compatible.

Is PocketHAL going to be safe from this!?

http://blogs.msdn.com/windowsmobile/arc ... ement.aspx
Yes PocketHAL will work as-is.

PocketHAL doesn't rely on GAPI being present and is already using AllKeys().
When switching to AllKeys, how do you know which key is being pressed? GAPI gives you gxKeys with the keycodes stored in vkA, vkB, vkStart, vkUp, etc... If the keycodes are different across devices, GAPI at least tries to give you something to work with.

So... I guess the question is: How do you know the keycodes for the buttons on Windows Mobile devices? I'm looking to take GAPI completely out of the equation and that should be the last piece of the puzzle for me.

Thanks!
That's a good question.

What I have observed is that all (most?) devices actually return the same set of key codes. The thing is that you don't know which ones are best for "Start", "A", "B", or "C".

PocketHAL uses GAPI for the keylist, but not to lock the keys.
Thanks for the response, Thierry.

I guess if it can't load the gx.dll we should assume a common set of keycodes, but provide a remapping option (which is good to have anyway).
Well I get my keystrokes via the WM_KEYDOWN and WM_KEYUP messages. Inside my application framework is this MsgProc function.

Code:

LRESULT TApplication::MsgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch(uMsg)
{
case WM_KEYDOWN:
//
// disable repeating keypresses
if (!(lParam & 0x40000000))
{
ButtonDown(wParam);
}
return 0;

case WM_KEYUP:
ButtonUp(wParam);
return 0;
}

return DefWindowProc(hWnd, uMsg, wParam, lParam);
}




And then inside my ButtonDown/Up calls you can do this:

Code:

void TApp::ButtonDown(int nButton)
{
if (nButton == VK_TUP)
{
// button up code
}

if (nButton == VK_TDOWN)
{
// button down
}

if (nButton == VK_TRIGHT)
{
}

if (nButton == VK_TLEFT)
{
}

if (nButton == VK_SOFT1)
{
// left soft key usually
}

if (nButton == VK_ACTION)
{
// middle action/thumb button
}
}


That seems to work well on the many many phones I've tried. The VK_ defines are defined in wmuser.h if I recall correctly. Best bet is to move your cursor over VK_ACTION and hit F12 (if your running Visual Studio) and that will bring up the defines. There are defines there for the CALL and END button and a bunch of others.