Add an AltGr key; full-mode letters flick to their AltGr symbol

The right alt in full mode is now AltGr: sticky like the other modifiers,
it types the keymap's third/fourth level (sk: AltGr+J = ') instead of an
Alt shortcut. In hold-keys mode it holds the physical right alt, since
KWin resets the modifier state after an ISO_Level3_Shift keysym.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-30 23:59:37 +01:00
co-authored by Claude Opus 5.5
parent 441c1d615b
commit b50667e508
18 changed files with 167 additions and 52 deletions
+23
View File
@@ -328,6 +328,29 @@ private Q_SLOTS:
QCOMPARE(controller->modifierModes().value(u"alt"_s).toInt(), int(KeyboardController::ShiftMode::Off));
}
void altGrTypesTheThirdLevel()
{
KeyDef j = makeKey(KeyType::Character, u"j"_s);
j.altGr = u"'"_s;
tap(modifierKey(u"altgr"_s));
tap(j);
QCOMPARE(engine.output, u"'");
QVERIFY(engine.keysyms.isEmpty()); // text, not an Alt shortcut
tap(j); // one-shot
QCOMPARE(engine.output, u"'j");
}
void altGrDeadKeyComposes()
{
KeyDef three = makeKey(KeyType::Character, u"3"_s);
three.altGr = u"^"_s;
three.deadAltGr = XKB_KEY_dead_circumflex;
tap(modifierKey(u"altgr"_s));
tap(three);
tap(makeKey(KeyType::Character, u"a"_s));
QCOMPARE(engine.output, u"â");
}
void tappedShiftAppliesToFunctionKeys()
{
tap(makeKey(KeyType::Character, u"a"_s)); // mid-sentence: no auto-shift