Re: [AD] linux keyboard mapping?

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Wed, Nov 06, 2002 at 09:18:41PM +0100, Elias Pschernig wrote:
> Personally, I'm also not completely sure about this (is/will be there
> really no keyboard with more than 128 keys?). Anyway, Eric told me in

Current keybaords (AFAIK this hasn't changed since I was hacking int 9)
use a byte to represent an event. The low 7 bits (eg 0-127) are the scan
code of the key, and the high bit it set for a make code (key is pressed)
and clear for a break code (key is released).
Some keys are different. Extended codes first send a byte (can't remember
if it is 0x00 or 0x0E, I think it's 0x00) and then another one (eg the
arrow keys). PrintScreen doesn't send a make/break code, but a stream
of 5 bytes. So it's possible to have more than 128 keys if the hardware
does some nasty things, but not in the general case (or software that
was coded for current keyboards won't work anymore (though there are not
many programs still using int 9 directly apart from OSes I guess)).

-- 
Vincent Penquerc'h



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/