Re: [AD] key scan codes have changed?

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


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


/examples/exkeys  4.1.18  'alt-a' & 'a' produce different values.
but in 4.2.0 b2  'alt-a' and 'a'  produce the same scan code.



> 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


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click





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