Re: [AD] num lock dependent scancode conversion (formerly: nld_readkey())

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


On 12 Sep 2000 21:23:34 +0700 Michael Bukin <M.A.Bukin@xxxxxxxxxx>
writes:
[clipped]
> I agree that it would be nice to allow convertion of numpad keys to
their other 
> meaning.  There are some problems though:
> 
> 1) keyboard handler uses scancode to set flag in 'key' array, it uses
> the same scancode to clear flag in 'key' array.  If you change
> scancode for numpad keypress, but don't change it on keyrelease, flag
> will stuck in 'key' array.  If you change scancodes for both keypress
> and keyrelease, according to numlock state, then if user releases
> numlock before releasing numpad key, it will stuck too.

I didn't see that. Thanks for pointing it out to me!

Here are my ideas to fix those problems:
 1. Before processing the key release, the same conversion takes place.
 2. Using an array, keep track if a converted key pad scancode has been
pressed, when a release occurs, only convert if the key pad key being
released has been recorded to have been pressed as an converted scancode.

The patch attached implements those ideas. From what I have observed,
they work as intended,

[clipped]
> Does the following program work correctly with your modifications?
[clipped]

even using that test program.

Have a great day!
Stephen Kittelson

Attachment: pckeys.c.wip3933.diff
Description: Binary data



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