OK, This is my first question and all my points are up for grabs. I can earn them back later. :o)
I have successfully created a system-wide keyboard hooking application. It is an auto-correct application that has a buffer of the last X keys and does automatic spell checking as well as a custom short-hand for fast typing. It is written in Delphi and uses shared memory to communicate between the DLL and the EXE. I hook the keyboard, mouse, and CBT to track the state of the system. I create a message buffer and use JournalPlayback to start send backspaces and the replacement text as if the user had typed it.
That's just a bit of background to tell you I more or less know what I'm doing. The system is created in Delphi, but I can work with C sources without problem.
How can I make it work on non-english keyboards? For instance to create spanish characters I've read that users press ALT+1+4+0 to get an I with a caret over it. There are also things called Dead Keys which can modify some key presses and have to be ignored.
Currently I have a lookup table of 256 values that I use to translate WParam of (30 Hex or 48 Dec) to '0' or ')' depending on Shift State, and then I add it to my buffer. I built these by hand for each ascii key, but I think this is the source of my problems when the keyboards are changed.
I would like to see...
1) source code snippets using keyboard hooks to translate hook data into a buffer, that can handle ALT+1+4+0 type sequences producing a single keypress, and similar code for handling dead keys.
~ or failing that ~
2) Links to relevant documentation so I can accomplish this myself.
Please ask if there is anything I'm have not made clear.
Thank You!
Start Free Trial