Thread View: comp.os.os2.programmer.misc
2 messages
2 total messages
Started by Keith R. Bennett
Mon, 25 Apr 1994 18:57
Arrow Key Problem w/Custom Keyboard Controller
Author: Keith R. Bennett
Date: Mon, 25 Apr 1994 18:57
Date: Mon, 25 Apr 1994 18:57
50 lines
3092 bytes
3092 bytes
This message is about a problem we're having with a custom-made keyboard controller under OS/2. We're using a special kind of input device (a control wheel, or knob). It's connected to a keyboard controller based on a Motorola USAR SC405367FN chip. This custom made controller translates moves and presses of the wheel into key codes that are presumably compatible with the usual PC AT compatible keyboard. Turns of the wheel are translated into arrow keys. The problem is this: in PM applications, the arrow key messages don't function properly. I wrote a test program to see what my ClientWndProc was receiving. I wrote to a file all the info coming in with the WM_CHAR message. Both the custom and the standard controller were tested. When comparing them, the *only* difference was that: 1) the KC_VIRTUALKEY flag was not set with the custom controller 2) (Perhaps as a result of the above,) the virtual key code was zero. The scan codes were correct with both controllers. The problem occurs *only* in PM apps, not in full screen apps. Also, when tested with a standard keyboard and controller, this problem did not occur. I looked up the BIOS function calls for the keyboard, and there is no such information as a virtual key flag. (I know that OS/2 doesn't use the BIOS, but I wanted to see what information it provided.) How does OS/2 know its value? Does it infer from the scan code whether or not it's a virtual key? Can anyone tell me what's happening here? Does PM infer from the scan code whether or not it's a virtual key? Or is it the reverse, does it decide to find the virtual key code because the virtual key flag is set? Is there any information coming from the keyboard controller other than the scan code and shift states? Thanks for any help. If you have information that may help, please feel free to call collect (from continental US or Canada), at (703) 941-5952. - Keith -- -------------------------------------------------------------------------- Keith Bennett Bennett Business Solutions, Inc. C++/C Software Development 1605 Ingram Terrace kbennett@access.digex.net Silver Spring, MD USA 20906-5932
Re: Arrow Key Problem w/Custom Keyboard Controller
Author: Christopher Wong
Date: Tue, 26 Apr 1994 00:36
Date: Tue, 26 Apr 1994 00:36
40 lines
3189 bytes
3189 bytes
In article <2ph3r3$q0k@access1.digex.net>, Keith R. Bennett wrote: > We're using a special kind of input device (a control wheel, or > knob). It's connected to a keyboard controller based on a Motorola > USAR SC405367FN chip. This custom made controller translates moves > and presses of the wheel into key codes that are presumably > compatible with the usual PC AT compatible keyboard. Turns of the > wheel are translated into arrow keys. > > The problem is this: in PM applications, the arrow key messages don't > function properly. I wrote a test program to see what my > ClientWndProc was receiving. I wrote to a file all the info coming in > with the WM_CHAR message. Both the custom and the standard controller > were tested. When comparing them, the *only* difference was that: > > 1) the KC_VIRTUALKEY flag was not set with the custom controller > 2) (Perhaps as a result of the above,) the virtual key code was zero. Users of certain Mitsumi keyboards are familiar with this problem. I believe the kbd01.sys device driver puts in the virtual key flag and code based on the raw scan code. This is the uscancode parameter passed as part of the WM_CHAR message. What is probably happening in your case is that the keyboard controller looks to OS/2 like a PC AT keyboard: the 83 key type. It would thus not have the extended cursor keys. Simultaneously, it may be transmitting the extended arrow keys' raw scancodes. The keyboard driver, thinking these keys do not exist, does not plug in the virtual key flag and codes. One solution is to patch kbd01.sys to force it to recognize a 101 keyboard. I do not have the info to do this. Another solution is to install a system input hook that watches for the arrow keys' WM_CHAR messages and refits them with the virtual key flag and codes. This, I have done. You can ftp the executable and source code from ftp.cdrom.com pub/os2/2_x/miscutil/fixkey.zip I wrote this to fix problems with conventional keyboards. I do not know what its effect is on your custom controller or even non-Mitsumi keyboards. Still, the source code is provided for you to customize.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads