2
Answers

Keyboard events

Peter

Peter

15y
2.8k
1
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
Answers (2)
0
Peter

Peter

NA 4 0 15y
My apology Sam for not being clear. We're converting an old windows app (between 20-25 yrs old) into a new windows app using ASP.NET 3.5). One of the requirements is to support an old keyboard, which is not a PC keyboard. The only similarity it has with a PC keyboard is the Alpha Numeric keys. The rest are function keys. Unlike the current windows with features such as tabs, these "function" keys performs single task only.

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
0
Sam Hobbs

Sam Hobbs

NA 28.7k 1.3m 15y
Whatever you are doing, it is likely causing the problem. The keyboard is not the problem. The original IBM PC keyboard used a connector about four times larger than the currently used connectors. Your keyboard is not that old, since if it were, then it would be connected to a motherboard that is too slow for current versions of Windows and such. All motherboards capable of supporting Windows would use keyboards supported by Windows. Even the old keyboards would work if they were connected using an adapter to connct to the motherboard. Keyboards send scan codes that Windows converts to virtual key codes that Windows programs use.

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.