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:
@@ -0,0 +1,43 @@
|
||||
#include "input/DeadKeys.h"
|
||||
|
||||
#include <QTest>
|
||||
#include <xkbcommon/xkbcommon-keysyms.h>
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
class TestDeadKeys : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private Q_SLOTS:
|
||||
void composesWithTheNextLetter()
|
||||
{
|
||||
DeadKeys dead(u"en_US.UTF-8"_s);
|
||||
QVERIFY(!dead.isPending());
|
||||
dead.press(XKB_KEY_dead_acute);
|
||||
QVERIFY(dead.isPending());
|
||||
QCOMPARE(dead.compose(u"e"_s), u"é");
|
||||
QVERIFY(!dead.isPending());
|
||||
|
||||
dead.press(XKB_KEY_dead_caron);
|
||||
QCOMPARE(dead.compose(u"C"_s), u"Č");
|
||||
}
|
||||
|
||||
void typesAccentAndLetterWhenNothingComposes()
|
||||
{
|
||||
DeadKeys dead(u"en_US.UTF-8"_s);
|
||||
dead.press(XKB_KEY_dead_caron);
|
||||
QCOMPARE(dead.compose(u"q"_s), u"ˇq");
|
||||
}
|
||||
|
||||
void cancelForgetsTheAccent()
|
||||
{
|
||||
DeadKeys dead(u"en_US.UTF-8"_s);
|
||||
dead.press(XKB_KEY_dead_acute);
|
||||
dead.cancel();
|
||||
QVERIFY(!dead.isPending());
|
||||
}
|
||||
};
|
||||
|
||||
QTEST_GUILESS_MAIN(TestDeadKeys)
|
||||
#include "tst_deadkeys.moc"
|
||||
Reference in New Issue
Block a user