Keyboard events
Hello all!! I'm currently developing a windows application which supports a very old
keyboard (about 25 years old). In order to make it work, I have to redefine some
of the functional keys values from that old keyboard to a unique value. I'm using the Windows API function keybd_event. Everything works fine until the
application crashes. It will then completely redefine all of the keys, including
my Windows keyboard. For example, my letter 'A" becomes a tab. Any advice is greatly appreciate it!!!
Thanks,
Petetr
PeterPosted Feb 27, 2010, 6:10 PM
Unfortunately, the ascii values for some of these function keys conflicts with often used PC keys such as a numeric zero. Therefore, to prevent that from happening, I must assign a different value for that function key. I decided to assign values that a user will most likely never use.
For the task, I created a Windows Service application to capture the keystrokes. If the keystroke is any of those functional keys, I give it a different value, other that that, I leave it alone.
Since I started this thread, I noticed that the windows service application does not have to crash to cause the Windows keyboard to go wacky!!! It just did few minutes ago. In fact I could'nt enter anything. But my mouse still works, so I stopped the windows service app and I'm able to type again.
Anyways,
Thanks for answering and I hope you can offer some suggestion for me.
Regards,
Peter
Sam HobbsPosted Feb 25, 2010, 10:25 PM
Why do you say "redefine all of the keys"? I don't understand that. You can't modify the scan codes that the keyboard sends to the system. Windows never modifies the scan codes sent by the keyboard; it cannot and would not.