Full keyboard mode, Ctrl/Alt/Super, dead keys, shift levels

- Full (iPad Pro) mode: every typing key from the keymap, number row,
  tab, caps lock, ctrl/super/alt; shifted symbol shown above and flickable
- Dead keys compose with the locale's XKB compose table
- Ctrl/Alt/Super stick like shift and turn keys into shortcuts; a tapped
  or held shift joins shortcuts and non-text keys, auto-shift and caps
  lock don't
- Auto-capitalization and caps lock only capitalize letters; the user's
  shift picks the keymap's shifted level
- Mode switch in settings keeps key size by resizing the window

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-14 21:29:24 +02:00
co-authored by Claude Opus 5.5
parent 88338fde22
commit ba2f17d665
36 changed files with 948 additions and 202 deletions
+32
View File
@@ -1,6 +1,7 @@
#include "TestLayouts.h"
#include <QTest>
#include <xkbcommon/xkbcommon-keysyms.h>
using namespace Qt::StringLiterals;
@@ -90,6 +91,37 @@ private Q_SLOTS:
QVERIFY(a.contains(u"á"_s));
}
void fullModeHasEveryTypingKey()
{
const Layout us = TestLayouts::build("us", KeyboardMode::Full);
const auto labels = [&](int row) {
QString text;
for (const KeyDef &key : us.layers.first().rows[row]) {
if (key.type == KeyType::Character)
text += key.label;
}
return text;
};
QCOMPARE(labels(0), u"`1234567890-=");
QCOMPARE(labels(1), u"qwertyuiop[]\\");
QCOMPARE(labels(2), u"asdfghjkl;'");
QCOMPARE(labels(3), u"zxcvbnm,./"); // LSGT (< >) repeats , . shifted: left out
QCOMPARE(letterKey(us, u"1"_s).flick, u"!");
QCOMPARE(letterKey(us, u"1"_s).shifted, u"!");
}
void fullModeKeepsDeadKeysAndKeymapShift()
{
const Layout sk = TestLayouts::build("sk", KeyboardMode::Full);
const KeyDef &acute = letterKey(sk, u"´"_s);
QCOMPARE(acute.dead, quint32(XKB_KEY_dead_acute));
QCOMPARE(acute.deadShifted, quint32(XKB_KEY_dead_caron));
QCOMPARE(letterKey(sk, u"ô"_s).shifted, u"\""); // as the physical key
QCOMPARE(letterKey(sk, u"ľ"_s).shifted, u"2");
// ľ has its own key now, so it's not a long-press choice on l.
QVERIFY(!letterKey(sk, u"l"_s).alternates.contains(u"ľ"_s));
}
void noPlaceholdersRemain()
{
for (const Layer &layer : TestLayouts::build("us").layers) {