Re: [AD] Question about keyboard handling (431)

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


On 2009-07-22, Arthur Ward <lists@xxxxxxxxxx> wrote:
> Hi all.

Hello, sorry for the late reply.

> 
> I've just tracked down a problem with a game I was compiling for Amiga OS
> where text input was being problematic.  It turned out that if I press
> shift (or any modifier key) then the value returned by readkey() will have
> the scancode for shift in the upper byte but zero in the lower byte.

I believe readkey() should not be reporting anything for modifier keys.

> This doesn't seem right.  In my keyboard handler, when I call the internal
> _handle_key_press() and pass in the ASCII code and the scancode, what
> should I pass in for the ASCII code?  Currently I am passing in zero if a
> modifier key is pressed.  What about for other keys such as the function
> keys?  They don't have an ASCII code, but if you pass in zero then it will
> filter through to readkey() and cause problems for client software.

Non-modifier keys don't have ASCII codes should return zero as the code.
Client software needs to be aware of this.

It's a long time since I've worked with Allegro 4 so I might be wrong.

Peter




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