🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2.programmer.misc
Article #229

Re: Arrow Key Problem w/Custom Keyboard Controller

#229
From: Christopher Wong
Date: Tue, 26 Apr 1994 00:36
40 lines
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.
Technical Details
Message-ID: <lF5ljms8e6VH062yn@husc4.harvard.edu>
Path: arc1-ca.pugleaf.net!gmd.de!nntp.gmd.de!dearn!blekul11!ccsdec1.ufsia.ac.be!reks.uia.ac.be!ub4b!EU.net! howland.reston.ans.net!wupost!udel!MathWorks.Com!yeshua.marcam.com!zip.eecs.umich.edu!newsxfer.itd.umich.edu!gumby!yale!yale.edu!noc.near.net!das-news.harvard.edu!husc-news.harvard.edu!husc.harvard.edu!husc8.harvard.edu!wong1
References: <2ph3r3$q0k@access1.digex.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cd94,2fdeaaca2f85e138
X-Google-Attributes: gid10cd94,public
X-Google-Thread: 11307a,2fdeaaca2f85e138
X-Google-Attributes: gid11307a,public
X-Google-ArrivalTime: 1994-04-26 02:07:00 PST
Path: arc1-ca.pugleaf.net!gmd.de!nntp.gmd.de!dearn!blekul11!ccsdec1.ufsia.ac.be!reks.uia.ac.be!ub4b!EU.net! howland.reston.ans.net!wupost!udel!MathWorks.Com!yeshua.marcam.com!zip.eecs.umich.edu!newsxfer.itd.umich.edu!gumby!yale!yale.edu!noc.near.net!das-news.harvard.edu!husc-news.harvard.edu!husc.harvard.edu!husc8.harvard.edu!wong1
Newsgroups: comp.os.os2.programmer.misc,bit.listserv.os2-l
Subject: Re: Arrow Key Problem w/Custom Keyboard Controller
Message-ID: <lF5ljms8e6VH062yn@husc4.harvard.edu>
From: wong1@husc4.harvard.edu (Christopher Wong)
Date: Mon, 25 Apr 1994 19:36:15 -0500
References: <2ph3r3$q0k@access1.digex.net>
Organization: Harvard University, Cambridge, Massachusetts
NNTP-Posting-Host: husc8.harvard.edu
Originator: wong1@husc8.harvard.edu
Lines: 42