Re: [AD] Scancodes for pause key

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


Michael Bukin <M.A.Bukin@xxxxxxxxxx> writes:
> I want to know which scancodes are sent by hardware.  Pause is a strange 
> key which sends completely different sequence of scancodes than any other 
> key.  For each key received from X-server, I send sequence of scancodes to 
> _handle_pckey, but I don't know what should be sent for Pause key.

Sorry for the late reply, but in case you haven't already figured this out:

The PCGPE says:

   Pause/Break

   Welcome to hell. If you press this key while either of the the control 
   keys are being held down, it will behave like extended key 70, at all 
   other times it will send the following bytes: (225, 29, 69, 225, 157, 
   197). Holding the key down does not result in autorepeat. Taking your 
   finger off the key does not send any extra bytes, they appear to be sent 
   after the "key down" bytes when you first press the key. Notice that 225 
   isn't 224, so our normal extended character handler will not take care of 
   this. My personal theory is that while a scan code of 224 (E0h) means 
   there is 1 more character following, a scan code of 225 (E1h) means there 
   are *2* more following. I've seen a number of keyboard handler libraries 
   and they all seem to overlook this key. So why not be the first kid on 
   your block to have a keyboard handler which properly supports the 
   Pause/Break key? CHECK IT OUT!!


But as far as Allegro is concerned, you just need to send 0xE1 when the 
pause key is pressed, and then five other values which will be skipped: the 
handler just ignores the next five interrupts after this key is pressed.

The other strange thing about the pause key is that it only signals being 
pressed: there is no release interrupt at all, so the Allegro keystate 
toggles on and off each time you press it. I assume the X input will give 
you the same sort of thing, since that is all the hardware provides, but 
presumably other hardware systems don't have this stupid problem.

I'd love to sit down with the guy who designed the original IBM keyboard, 
and ask him what the hell he was smoking at the time :-)


--
Shawn Hargreaves - shawn@xxxxxxxxxx - http://www.talula.demon.co.uk/
"A binary is barely software: it's more like hardware on a floppy disk."



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