Re: [AD] key scan codes have changed?

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


On Mon, 2005-04-25 at 12:17 +0200, Evert Glebbeek wrote:
> > > the key scan codes between 4.1.18  and 4.2.0 b2  have changed.
> > > is this supposed to have happenend ?
> > > 
> > > all my ALT A-Z keys now respond like A-Z keys :(
> > > 
> > 
> > I think they have, but why are you using the raw numbers? You can't
> > expect them to stay constant.
> 
> No, but scancodes should still be scancodes, I think.
> That said, I'm not entirely sure if what AJ is describing is a bug or not 
> because I'm not sure what he means by `scancode' (the raw return value of 
> readkey() or a processed one), but I tend to think that it is. The 
> following is the documented behavior of readkey directly from the manual:
> 
>           val = readkey();
>           if ((val & 0xff) == 'd')     /* by ASCII code */
>              allegro_message("You pressed 'd'\n");
> 
>           if ((val >> 8) == KEY_SPACE) /* by scancode */
>              allegro_message("You pressed Space\n");
> 
>           if ((val & 0xff) == 3)       /* ctrl+letter */
>              allegro_message("You pressed Control+C\n");
> 
>           if (val == (KEY_X << 8))     /* alt+letter */
>              allegro_message("You pressed Alt+X\n");
> 
> If readkey doesn't behave like that, it's a bug.

Yes, that shouldn't have changed. But I guess, DirectX reports different
codes than pckeys.c did, so we'll have to manually override them. I'll
look at it next time I'm in windows, if nobody else does. It would
simply be a case of adding a special case to wkeybd.c for the alt+letter
keys, there are already a lot of special cases anyway from what I
remember.

-- 
Elias Pschernig





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