Here's the scenario: you are working on a DirectDraw full screen application and you require full control of the device keyboard. Things have worked nicely with the Pocket PC and even with the WM5 Smartphone, but when you move to WM6 your keyboard is gone. You do get the
WM_KEYDOWN and
WM_KEYUP messages, but most of them only report the dreaded
VK_PROCESSKEY and
ImmGetVirtualKey() does not seem to help at all. What can you do?
I found a solution for this problem that solves most of the issues above, but also uncovers some other issues. The solution is to call
ImmAssociateContext() on your main window passing
NULL as the
HIMC parameter. This will remove the input context association from the window, and you get the keyboard back. But...
... now you have to handle the keyboard mappings yourself. That's the price you pay. On some devices this means having a mixed keyboard (numbers and alpha keys) so you must internally implement a keyboard map in order to make it work as the user expects. To make matters worse, the keyboard map is device dependent so you are in for a bit of work. Finally, I have found that on some devices you don't get all the keys, especially the special keys for mail and contacts. These devices seem to have these keys wired to launch the matching applications and not even GAPI seems to release them...