keyboard remapping
-
Hi, does anybody know (can tell us/point us to source code/docs) how to change keyboard mappings for the whole system. Eg. say we want to have Ctrl-K act as if someone pressed the Down Arrow. Can we intercept keyboard messages for the whole system, and then change them before other applications receive them? thanks in advance
-
Hi, does anybody know (can tell us/point us to source code/docs) how to change keyboard mappings for the whole system. Eg. say we want to have Ctrl-K act as if someone pressed the Down Arrow. Can we intercept keyboard messages for the whole system, and then change them before other applications receive them? thanks in advance
I suppose you could write a filter and attach it to the driver stack. That way you could modify the IRP before it reaches the RIT. Take a look at kbfiltr in the DDK. There is also another another similar solution at www.sysinternals.com (ctrl2cap), but kbfiltr seems to give you more freedom to manipulate the entire buffer, like inserting keystrokes. BTW, I will probably have to write something similar in a couple of weeks, so if you find another way I'd be glad to hear about it... /moliate
The corners of my eyes catch hasty, bloodless motion - a mouse? Well, certainly a peripheral of some kind.
Neil Gaiman - Cold Colours
-
Hi, does anybody know (can tell us/point us to source code/docs) how to change keyboard mappings for the whole system. Eg. say we want to have Ctrl-K act as if someone pressed the Down Arrow. Can we intercept keyboard messages for the whole system, and then change them before other applications receive them? thanks in advance
Rather than using the driver idea (which would work, but is yeuch), you could look at SetWindowsHookEx (WH_KEYBOARD/WH_KEYBOARD_LL, ...) which can be used for your purpose. Just a search in MSDN gives many examples. (And you can debug it more easily!) Iain.