I was digging into how keyboards acutally work and how Teensy 4.1 implements those details. I came across 'special' key combinations involving "KEY_NON_US_100" and I might have found something, which (in my opinion) doesn't work as intended.
I was specifically looking into German (DE) keyboard layout with Teensy 4.1. What I wanted to achieve is pressing to correct key combination to get "<", ">" and "|". To get those inputs on a physical german keyboard with OS set to "german" (e.g. use "setxkbmap de" on a Linux), you have to press the additional special key next to the "LSHIFT" button, which I assume should be defined in "keylayouts.h" as "KEY_NON_US_100".
Expected behaviour, when pressing key combinations:
[KEY_NON_US_100] : "<"
[KEY_NON_US_100 + SHIFT] : ">"
[KEY_NON_US_100 + ALT + CTRL] : "|" // combination "ALT + CTRL" can also be achieved by using "ALTGR"
Observed behaviour, when pressing the key combinations with Teensy 4.1:
[KEY_NON_US_100] : "?"
[KEY_NON_US_100 + SHIFT] : "?"
[KEY_NON_US_100 + ALT + CTRL] : "¿"
Definition in keylayouts.h:
----------------------------------------------------
#ifdef LAYOUT_GERMAN
[...]
#define KEY_NON_US_100 63
[...]
#define ASCII_3C KEY_NON_US_100 // 60 <
#define ASCII_3D KEY_0 + SHIFT_MASK // 61
#define ASCII_3E KEY_NON_US_100 + SHIFT_MASK // 62 >
#define ASCII_3F KEY_MINUS + SHIFT_MASK // 63 ?
[...]
#define ASCII_7C KEY_NON_US_100 + ALTGR_MASK // 124 |
----------------------------------------------------
In my opinion, "#define KEY_NON_US_100 63" is possibly wrong. When changing the definition to:
#define KEY_NON_US_100 60
the observed behaviour matches the expected behaviour and I'm able to acutally input "<", ">" and "|" with the Teensy.
I'd highly appreciate, if someone with more knowledge in this field could take a look at it.
If this is a bug, this might also have implications for other layouts using 'KEY_NON_US_100'.
Thank you very much in advance!
I was specifically looking into German (DE) keyboard layout with Teensy 4.1. What I wanted to achieve is pressing to correct key combination to get "<", ">" and "|". To get those inputs on a physical german keyboard with OS set to "german" (e.g. use "setxkbmap de" on a Linux), you have to press the additional special key next to the "LSHIFT" button, which I assume should be defined in "keylayouts.h" as "KEY_NON_US_100".
Expected behaviour, when pressing key combinations:
[KEY_NON_US_100] : "<"
[KEY_NON_US_100 + SHIFT] : ">"
[KEY_NON_US_100 + ALT + CTRL] : "|" // combination "ALT + CTRL" can also be achieved by using "ALTGR"
Observed behaviour, when pressing the key combinations with Teensy 4.1:
[KEY_NON_US_100] : "?"
[KEY_NON_US_100 + SHIFT] : "?"
[KEY_NON_US_100 + ALT + CTRL] : "¿"
Definition in keylayouts.h:
----------------------------------------------------
#ifdef LAYOUT_GERMAN
[...]
#define KEY_NON_US_100 63
[...]
#define ASCII_3C KEY_NON_US_100 // 60 <
#define ASCII_3D KEY_0 + SHIFT_MASK // 61
#define ASCII_3E KEY_NON_US_100 + SHIFT_MASK // 62 >
#define ASCII_3F KEY_MINUS + SHIFT_MASK // 63 ?
[...]
#define ASCII_7C KEY_NON_US_100 + ALTGR_MASK // 124 |
----------------------------------------------------
In my opinion, "#define KEY_NON_US_100 63" is possibly wrong. When changing the definition to:
#define KEY_NON_US_100 60
the observed behaviour matches the expected behaviour and I'm able to acutally input "<", ">" and "|" with the Teensy.
I'd highly appreciate, if someone with more knowledge in this field could take a look at it.
If this is a bug, this might also have implications for other layouts using 'KEY_NON_US_100'.
Thank you very much in advance!