Hallo!
I’m attempting a fork of @algernon’s Hungarian language pack. So far, with some success, but then again, my successful modifications have all been trivial. It’s 3AM, so I decided to throw in the towel and ask for help!
I’ve gotten ä, ö, and ü (and their capitalized variants) to work properly, but the ß eludes me. While typing each key in the following keymap snippet
R(DEU_AU), R(DEU_OU), R(DEU_UU), R(DEU_SSch),
I get the following output:
äöüs
It’s odd that the ones requiring three keystrokes work, whereas the one requiring only two does not. Frustrating. Hoping it’s very straightforward and only a mystery because I’m completely inexperienced in C++. My Java background only got me so far.
Here’s my eventHandlerHook method at the current revision. Below is the whole snippet:
German::eventHandlerHook
German::eventHandlerHook(Key mapped_key, byte row, byte col, uint8_t key_state) {
if (mapped_key.raw < GERMAN_FIRST || mapped_key.raw > GERMAN_LAST)
return mapped_key;
if (!keyToggledOn(key_state))
return Key_NoKey;
bool need_shift = Keyboard.isModifierActive(Key_LeftShift.keyCode) ||
::OneShot.isModifierActive(Key_LeftShift);
tap_key(Key_RightAlt.keyCode);
GermanSymbol symbol = (GermanSymbol)(mapped_key.raw - GERMAN_FIRST);
Key accent;
uint8_t kc = 0;
accent.flags = KEY_FLAGS;
accent.keyCode = Key_Quote.raw;
switch (symbol) {
case AU:
kc = Key_A.keyCode;
accent.flags |= SHIFT_HELD;
break;
case OU:
kc = Key_O.keyCode;
accent.flags |= SHIFT_HELD;
break;
case UU:
kc = Key_U.keyCode;
accent.flags |= SHIFT_HELD;
break;
case SS:
kc = Key_S.keyCode;
break;
}
if (accent.flags & SHIFT_HELD)
Keyboard.press(Key_LeftShift.keyCode);
else
Keyboard.release(Key_LeftShift.keyCode);
Keyboard.sendReport();
tap_key(accent.keyCode);
if (need_shift)
Keyboard.press(Key_LeftShift.keyCode);
else
Keyboard.release(Key_LeftShift.keyCode);
tap_key(kc);
return Key_NoKey;
}
I greatly appreciate any insights!