liballeg/allegro5

Alt-Graph Keys not recognized on Windows

egrath opened this issue · 4 comments

egrath commented

Issue
On Windows, characters which are entered using Alt-Graph+Key combinations are not recognized, but instead only the regular Key.

To demonstrate the issue, i've adopted one of the official examples (attached). On both runs, Alt-Graph+Q was pressed to produce the at-Symbol (@):

Windows 11 (English) with german keyboard layout:

[KEY_DOWN]: keycode=[217], char=[], modifiers=[00000000](LCTRL)
[KEY_DOWN]: keycode=[220], char=[], modifiers=[00000000](ALTGR)
[KEY_DOWN]: keycode=[017], char=[], modifiers=[00000000](Q)
[KEY_CHAR]: keycode=[017], char=[q], modifiers=[00000242](Q)
[KEY_UP]: keycode=[017], char=[], modifiers=[00000000](Q)
[KEY_UP]: keycode=[217], char=[], modifiers=[00000000](LCTRL)
[KEY_UP]: keycode=[220], char=[], modifiers=[00000000](ALTGR)

Ubuntu 20.04 with german keyboard layout:

[KEY_DOWN]: keycode=[220], char=[], modifiers=[00000000](ISO_Level3_Shift)
[KEY_DOWN]: keycode=[017], char=[], modifiers=[00000000](q)
[KEY_CHAR]: keycode=[017], char=[@], modifiers=[00000220](q)
[KEY_UP]: keycode=[017], char=[], modifiers=[00000000](q)
[KEY_UP]: keycode=[220], char=[], modifiers=[00000000](ISO_Level3_Shift)

Only the later one correctly produces the @-symbol.

How to reproduce:
Build the attached application on Windows (MinGW, Allegro 5.2.8) and enter a Alt-Graph generated symbol like @ (Alt-Graph+Q).

Expected behavior:
Windows should recognized the keypress in the same way as Linux does.

If you need any further information which can help to get this bug fixed, please let me know.
keytest.zip