Re: [AD] key scan codes have changed?

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


> > 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.

Evert




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