PocketMatrix forums

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

X50v & GAPI key input

I am using GAPI [OpenInput()] to capture key input in my app. On an X50v I have the strange behavior that the keys are captured only after switching to another app and then back.

Specifically, what I am doing is
Code:
case WM_CREATE:
// some other stuff
GXOpenInput();
break;

case WM_SETFOCUS:
GXResume();
break;

case WM_KILLFOCUS:
GXSuspend();
break;



The app works properly on an X30.

Anyone any idea?

Thanks,
HM
For some reason it seems to be in suspend state after GXOpenInput() as far as i understand you. Maybe you can add a GXResume() after GXOpenInput() as workaround?

Tala
It seems like the window was not activated or was put into the foreground. Try:
Code:

case WM_KILLFOCUS:
exit(0); //Quit if losing focus
GXSuspend();
break;
You are using the wrong messages (WM_SETFOCUS/WM_KILLFOCUS). The proper way is:

Code:


case WM_ACTIVATE:
if (LOWORD(wparam)==WA_INACTIVE)
GXSuspend();
else
GXResume();
break;
Thierry wrote:You are using the wrong messages (WM_SETFOCUS/WM_KILLFOCUS). The proper way is:

Code:


case WM_ACTIVATE:
if (LOWORD(wparam)==WA_INACTIVE)
GXSuspend();
else
GXResume();
break;

Thanks Thierry, I'll try that. I based this on the MSDN documentation: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/apippc/html/ppc_gx_biaa.asp and http://msdn.microsoft.com/library/default.asp?url=/library/en-us/apippc/html/ppc_gx_biaa.asp.

- HM
It's wrong. Trust me. I hunted that one for quite some time for PocketFrog. I know WM_ACTIVATE works on all devices (PPC, Smartphone, PC, etc). The WM_SETFOCUS/WM_KILLFOCUS doeesn't.

The MSDN article is simply wrong, and if you understand what WM_SETFOCUS/WM_KILLFOCUS are, it makes sense.
Thierry wrote:It's wrong. Trust me. I hunted that one for quite some time for PocketFrog. I know WM_ACTIVATE works on all devices (PPC, Smartphone, PC, etc). The WM_SETFOCUS/WM_KILLFOCUS doeesn't.

The MSDN article is simply wrong, and if you understand what WM_SETFOCUS/WM_KILLFOCUS are, it makes sense.

Actually, I started out with WM_ACTIVATE, and then did the mistake of verifying my code against MSDN... :-)

Anyway, thanks again!

- HM