More long-press accents; number-row letters stay choices in full mode
- Template alternates cover Central/Eastern European, Turkish, Romanian, Baltic, Nordic and Esperanto letters, at most 11 per key - Only letters on the letter rows are skipped as choices, so sk ť, ľ, š… are offered on their base letter in full mode too Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+18
-12
@@ -2,18 +2,24 @@
|
||||
"id": "template",
|
||||
"name": "Template",
|
||||
"alternates": {
|
||||
"a": ["á", "à", "â", "ä", "æ", "ã", "å", "ā"],
|
||||
"c": ["ç", "ć", "č"],
|
||||
"d": ["ð"],
|
||||
"e": ["é", "è", "ê", "ë", "ē", "ė", "ę"],
|
||||
"i": ["í", "ì", "î", "ï", "ī", "į"],
|
||||
"l": ["ł"],
|
||||
"n": ["ñ", "ń"],
|
||||
"o": ["ó", "ò", "ô", "ö", "õ", "ø", "œ", "ō"],
|
||||
"s": ["ß", "ś", "š"],
|
||||
"t": ["þ"],
|
||||
"u": ["ú", "ù", "û", "ü", "ū"],
|
||||
"y": ["ý", "ÿ"],
|
||||
"a": ["á", "à", "â", "ä", "æ", "ã", "å", "ā", "ą", "ă", "ǎ"],
|
||||
"c": ["ç", "ć", "č", "ĉ", "ċ"],
|
||||
"d": ["ď", "đ", "ð"],
|
||||
"e": ["é", "è", "ê", "ë", "ē", "ė", "ę", "ě", "ẽ"],
|
||||
"g": ["ğ", "ĝ", "ģ", "ġ"],
|
||||
"h": ["ĥ", "ħ"],
|
||||
"i": ["í", "ì", "î", "ï", "ī", "į", "ı", "ǐ"],
|
||||
"j": ["ĵ"],
|
||||
"k": ["ķ"],
|
||||
"l": ["ł", "ľ", "ĺ", "ļ", "ŀ"],
|
||||
"n": ["ñ", "ń", "ň", "ņ", "ŋ"],
|
||||
"o": ["ó", "ò", "ô", "ö", "õ", "ø", "œ", "ō", "ő", "ǒ"],
|
||||
"r": ["ŕ", "ř"],
|
||||
"s": ["ß", "ś", "š", "ş", "ș", "ŝ"],
|
||||
"t": ["ť", "ţ", "ț", "þ"],
|
||||
"u": ["ú", "ù", "û", "ü", "ū", "ů", "ű", "ų", "ŭ", "ǔ"],
|
||||
"w": ["ŵ"],
|
||||
"y": ["ý", "ÿ", "ŷ"],
|
||||
"z": ["ž", "ź", "ż"]
|
||||
},
|
||||
"sections": [
|
||||
|
||||
@@ -101,14 +101,15 @@ Row expandPlaceholders(const Row &row, const KeymapKeys &keymap)
|
||||
return result;
|
||||
}
|
||||
|
||||
// Long-press choices per letter: the keymap's letters that have no key here
|
||||
// first (they're what this language types), then the template's.
|
||||
// Long-press choices per letter: the keymap's letters that have no letter key
|
||||
// first (they're what this language types), then the template's. Letters on the
|
||||
// number row (sk: ť) stay choices in full mode too: they're out of the way there.
|
||||
void addAlternates(Layer &layer, const Layout &tmpl, const KeymapKeys &keymap)
|
||||
{
|
||||
QSet<QString> onKeys;
|
||||
for (const Row &row : layer.rows) {
|
||||
for (const KeyDef &key : row)
|
||||
onKeys << key.label << key.shifted.toLower();
|
||||
for (int row = 0; row < 3; ++row) {
|
||||
for (const KeyDef &key : letterKeys(keymap, row, {}))
|
||||
onKeys << key.label;
|
||||
}
|
||||
|
||||
QHash<QString, QStringList> choices;
|
||||
|
||||
@@ -132,8 +132,9 @@ private Q_SLOTS:
|
||||
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));
|
||||
// Number-row letters are still long-press choices on their base letter.
|
||||
QCOMPARE(letterKey(sk, u"t"_s).alternates.first(), u"ť");
|
||||
QCOMPARE(letterKey(sk, u"l"_s).alternates.first(), u"ľ");
|
||||
}
|
||||
|
||||
void noPlaceholdersRemain()
|
||||
|
||||
Reference in New Issue
Block a user