Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keys are either mis-detected or mis-labeled in keybinding dialog (Neo2 keyboard layout) #13904

Open
erlehmann opened this issue Oct 21, 2023 · 7 comments
Labels
Unconfirmed bug Bug report that has not been confirmed to exist/be reproducible

Comments

@erlehmann
Copy link
Contributor

erlehmann commented Oct 21, 2023

Minetest version

5.7.0-279-gb1dec37ad
5.7.0-350-g8a9855241

Active renderer

OpenGL 1.4

Irrlicht device

X11 / SDL (both are bugged, but in a different way)

Operating system and version

Debian GNU/Linux 11.7

CPU model

Intel(R) Core(TM) Duo CPU T2400 @ 1.83GHz

GPU model

Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03)

OpenGL version

1.4

Summary

I tried to bind some keys in the keybinding dialog and think they are either mistranslated or mis-detected by Minetest:

Here are the keys I pressed, the German label I see after pressing them and what that translates to:

  • ISO_Level3_Shift left (above shift key) → Menü rechts (Menu right)
  • ISO_Level3_Shift right (next to enter key) → Menü rechts (Menu right)
  • Alt left → Menü links (Menu left)
  • Alt right → Linke Taste (literally: left key)
  • Acute (dead key) → OEM 6
  • Grave (dead key) → OEM 3
  • Circumflex (dead key) → OEM 5
  • ß → OEM 4
  • Num Lock (on keypad) → Tab (Tabulator)

Edit: The Num Lock key is apparently set to an actual tab character on my system.

Meanwhile, the Menu and Tab keys are correctly detected/labeled as ”Menü” and “Tab”.

My keyboard is a QWERTY keyboard with a numpad and my keyboard layout is German (Neo 2).

Steps to reproduce

  1. Start Minetest with German (Neo 2) keyboard layout and German locale.
  2. Try to bind some keys to some functions in the keybinding dialog.
  3. Look at the names of the keys that are diplayed.
@erlehmann erlehmann added the Unconfirmed bug Bug report that has not been confirmed to exist/be reproducible label Oct 21, 2023
@erlehmann
Copy link
Contributor Author

It seems that this issue is not translation-related: When I press the right “alt” key (in X11 lingo: ISO_Level5_Shift) in Minetest started with LANG=C, it displays “Left Button”.

@rubenwardy
Copy link
Member

This is another thing that show be fixed by SDL

@erlehmann
Copy link
Contributor Author

erlehmann commented Oct 21, 2023

I tried with a different keyboard (Thinkpad T60 QWERTZ) and had the same results, except that the Fn key was also detected as “Linke Taste” / “Left Button”, which probably means it is impossible to use numpad keys on laptops with the current version of Minetest (not that I do that, but …).

This is another thing that show be fixed by SDL

@rubenwardy do you mean it should be (i.e. will be) fixed some day or it should have (i.e. has) already been fixed?

@erlehmann erlehmann changed the title Keys are either mis-detected or mis-labeled in German localization of keybinding dialog Keys are either mis-detected or mis-labeled in keybinding dialog (Neo2 keyboard layout) Oct 21, 2023
@erlehmann
Copy link
Contributor Author

erlehmann commented Oct 21, 2023

@rubenwardy so I compiled Minetest at commit 5.7.0-350-g8a9855241 with SDL now and got the following:

  • Circumflex (dead key) → Linke Taste (Left Button)
  • Grave (dead key) → Linke Taste (Left Button)
  • Acute (dead key) → Linke Taste (Left Button)
  • Numpad Enter → Linke Taste (Left Button)
  • Numpad . → Linke Taste (Left Button)

I can almost see a pattern here, but ß is not recognized at all.

Edit: If anything, using SDL is worse than not using SDL here.

@grorp
Copy link
Member

grorp commented Oct 21, 2023

I think rubenwardy meant that it's possible to fix this using SDL, by replacing our own key name logic with SDL_GetKeyName.

@erlehmann
Copy link
Contributor Author

@v-rob has written a small SDL program to check keycodes and scancodes:
https://gist.github.com/v-rob/4ef28c7ae9f45fcf697dbc0f3a64ee5c

This is the result (partially correct, but still broken for modifier and dead keys):

  • Circumflex (dead key) → keycode= scancode=`
  • Grave (dead key) → keycode= scancode==
  • Acute (dead key) → keycode= scancode=]
  • Numpad Enter → keycode=Keypad Enter scancode=Keypad Enter
  • Numpad . → keycode=Keypad , scancode=Keypad . (this seems actually correct if I think about a German numpad)
  • ä → keycode=ä scancode=C
  • ö → keycode=ö scancode=X
  • ü → keycode=ü scancode=Z
  • ß → keycode=ß scancode=[
  • ISO_Level3_Shift left (above shift key) → keycode=Right Alt scancode=CapsLock
  • ISO_Level3_Shift right (next to enter key) → keycode=Right Alt scancode=\
  • Alt left → keycode=Left Alt scancode=Left Alt
  • Alt right → keycode= scancode=Right Alt

@v-rob
Copy link
Member

v-rob commented Oct 25, 2023

Looking at the Neo2 layout, scancodes all work as expected, which is good. Hopefully, we can use transition to SDL scancodes for in-game controls instead of keycodes. Formspecs still require keycodes (for e.g. shortcuts like Ctrl+C, not for character input), so we can't add scancode support until we fully transition to SDL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Unconfirmed bug Bug report that has not been confirmed to exist/be reproducible
Projects
None yet
Development

No branches or pull requests

4 participants