[comp.sys.ibm.pc.hardware] Problems with NUMLOCK key .. part 2

rfrost@spam.ua.oz.au (Richard Frost) (02/03/91)

Thanks to all those that responded to my original posting.

My previous posting was not clear enough as all who posted thought
I was dealing with this problem at a software level.

Let me put you all clearly in the picture..

   What we are trying to do at the company I work for is design a
   new keyboard for IBM XT and ATs (which includes full keyboard
   layout, PCB design, key design, plastic casings, packaging etc etc.).

   We are designing our own software to run in the keyboard micro
   to scan the keyboard, send the make & break codes etc.

   That is the level we are at, we are not writing software to run on
   an IBM to communicate with the BIOS to get keypresses etc.

Back to the question...

The extended keys on an IBM keyboard require the sending of a
prefix byte, E0 HEX before each make and break codes are sent.

ie. for the Grey Arrow Keys:     E0  4B     E0 CB
                                 (make)    (break)

    for the Keypad Arrow Keys:     4B      CB
                                 (make)  (break)

clearly the different sequences enable the computer to distinguish
between the extended & non-extended arrow keys.

Now, when NUMLOCK is enabled on the keyboard, the keypad arrow keys
can be used as number keys, however they still send out the same sequence
, its just that the computer interprets them differently as it
records the state of the NUMLOCK key.

The extended arrow keys also send out the same sequence but they still
remain as arrow keys, irrespective of whether the NUMLOCK key has been
pressed.

BUT, why is it, that by unplugging a keyboard after enabling NUMLOCK and
then plugging it back in, that it is possible to get NUMBERS to come
from the EXTENDED arrow keys as though they are keypad keys (the
keypad arrow keys put out numbers also). Surely the computer
can differentiate by looking at the E0 prefixes!

The above situation was observed on all the keyboards we have at work,
all designed by different manufacturers.


##  I would like to hear from people who have been involved with        ##
##  DESIGNING IBM keyboards and software for the micros that go in them ##
##  as they would have come across this problem.                        ##

Thanks
--
.---------------.------------------------------.-------------------------.
| Richard Frost | USENET: rfrost@spam.ua.oz.au | FIDONET:  3:680/805     |
.-------.-------^------------------------------^-------------------------|
| O F F | A NEW life awaits you in the OFF WORLD colony, the chance to   |
| WORLD | begin again in a golden land of opportunity and adventure !    |
`-------' New climates, recreational facilities ...                      |
| The custom tailored genetically engineered humanoid replicant designed |
| especially for YOUR needs !!                          .... BLADERUNNER |
`------------------------------------------------------------------------'

phil@ux1.cso.uiuc.edu (Phil Howard KA9WGN) (02/05/91)

rfrost@spam.ua.oz.au (Richard Frost) writes:

>BUT, why is it, that by unplugging a keyboard after enabling NUMLOCK and
>then plugging it back in, that it is possible to get NUMBERS to come
>from the EXTENDED arrow keys as though they are keypad keys (the
>keypad arrow keys put out numbers also). Surely the computer
>can differentiate by looking at the E0 prefixes!

Sounds to me like a BIOS bug that didn't expect, and was not tested with,
this "unusual" situation.  Does the NUMLOCK light come back on when the
keyboard is reattached?  Do things start working "right" again once the
NUMLOCK key is pressed again to reestablish numlock?

>The above situation was observed on all the keyboards we have at work,
>all designed by different manufacturers.

I might have to try this with my IBM Xstation 120 which uses the same
keyboard as my PS/2.

>##  I would like to hear from people who have been involved with        ##
>##  DESIGNING IBM keyboards and software for the micros that go in them ##
>##  as they would have come across this problem.                        ##

Can't help here.  I did once write a program that did its own interpretation
of the key up/down codes, but I never tried unplugging the keyboard.
-- 

--Phil Howard, KA9WGN-- | Individual CHOICE is fundamental to a free society
<phil@ux1.cso.uiuc.edu> | no matter what the particular issue is all about.