Register
Site Login
Site Search
Forums
Advertisement
Welcome to PocketMatrix. PocketMatrix is dedicated to providing the best online community for mobile device developers and enthusiests. What's new?

Windows 6.5 and GAPI


Windows 6.5 and GAPI

Postby Cardinal » May 11, 2009 @ 9:48pm

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
Cardinal
pm Member
 
Posts: 53
Joined: Feb 6, 2006 @ 5:39am
Location: Ottawa, Ontario


Postby Kzinti » May 11, 2009 @ 11:22pm

Yes PocketHAL will work as-is.

PocketHAL doesn't rely on GAPI being present and is already using AllKeys().
Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Postby Presto » May 18, 2009 @ 3:59pm

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!
<a href="http://www.pocketadventures.com/travel.asp"><img src="http://www.pocketadventures.com/images/ttc_banner.gif" border="0"></a>
User avatar
Presto
pm Insider
 
Posts: 763
Joined: Jan 20, 2003 @ 5:51am
Location: Kalesian Archipelago


Postby Kzinti » May 19, 2009 @ 9:16pm

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.
Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Postby Presto » May 20, 2009 @ 1:07pm

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).
User avatar
Presto
pm Insider
 
Posts: 763
Joined: Jan 20, 2003 @ 5:51am
Location: Kalesian Archipelago


Postby Cardinal » May 23, 2009 @ 7:47pm

Well I get my keystrokes via the WM_KEYDOWN and WM_KEYUP messages. Inside my application framework is this MsgProc function.

Code: Select all









10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
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);
}


22 lines; 7 keywds; 3 nums; 37 ops; 0 strs; 2 coms    Syntactic Coloring v0.4 - Dan East  


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

Code: Select all









10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
29 
30 
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
  }
}
30 lines; 8 keywds; 0 nums; 42 ops; 0 strs; 4 coms    Syntactic Coloring v0.4 - Dan East  


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.
Cardinal
pm Member
 
Posts: 53
Joined: Feb 6, 2006 @ 5:39am
Location: Ottawa, Ontario


Return to PocketFrog & PocketHAL


Sort


Forum Description

SDKs for fast and robust device-independent access to Pocket PC display hardware.

Moderators:

sponge, Kzinti

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron