![]() |
|
Not getting ALLEGRO_EVENT_KEY_CHAR events for SHIFT/CTRL/ALT keys |
geecab
Member #23,749
April 2023
|
Hi there! About 10 years ago I wrote a Sega Monaco GP Remake game using Allegro and have just noticed a something strange. I'm not getting ALLEGRO_EVENT_KEY_CHAR events for keycodes in the range of 215 (ALLEGRO_KEY_LSHIFT) to 226 (ALLEGRO_KEY_CAPSLOCK). ALLEGRO_EVENT_KEY_CHAR events work fine for basic keys (I.e. Keycodes in range of 1 (ALLEGRO_KEY_A) to 93 (ALLEGRO_KEY_PAUSE)). It is strange because ALLEGRO_EVENT_KEY_DOWN and ALLEGRO_EVENT_KEY_UP events all work fine regardless of keycode. I'm running Allegro 5.2.8 on Linux, and Allegro 5.0.10 on Windows. Many thanks, Ben |
torhu
Member #2,727
September 2002
![]() |
KEY_CHAR events are for characters input, not for keypresses. So for instance pressing Ctrl doesn't give you a character. |
geecab
Member #23,749
April 2023
|
Ah I see, many thanks for the response! |
|