Try have a look to this page and the related resources, from the
MSDN library:
http://msdn.microsoft.com/en-us/library/ms644990(VS.85).aspx[
^]
I think that what you need as first step is a
low-level keyboard hook (see
WH_KEYBOARD_LL
) to process keys before that they are dispatched to the active application.
Note that from the installed hook procedure you have only two choices:
- avoid further processing on the sent key
- call the next installed hook (this means that your application does nothing on the sent key, and if no more hooks are installed the sent key is dispatched to the active application)
Then to remap some keyboard keys what you should do is something like the following:
- install your hook procedure
- from your hook procedure identify the keyboard keys that shouldn't be remapped and let them be processed by calling
CallNextHookEx
- avoid processing of keyboard keys that should be remapped and send a
WM_CHAR
message with the remapped key code to the active application