Repository navigation
iOS: Czech keyboard, and custom words for typing - #2205
Merged
Merged
Conversation
…ip keeps to the sentence's language
A TestFlight tester (build 56, iPhone 17 Pro Max): "I use Czech and English
languages. But it isn't easy to switch between the languages, and
autocomplete suggests English words in Czech too."
Adds KeyboardLanguage.czech ("cs", Čeština), as Polish (#2143) and Greek
(#2184) were added. It matches the standard Czech layout and the system
keyboard's observed long-press options, as the iOS 27.2 simulator's own Czech
keyboard shows them (every letter, 123 and #+= key held for about 3 s with a
real touch, the callout read from the accessibility tree, the
keyboard-provenance survey and converter as since #2140; screenshots checked):
- Rows ("QWERTZ – Czech/Slovak", Apple's default): qwertzuiop / asdfghjkl´ /
yxcvbnmˇ. Rows 1 and 2 are ten keys edge to edge, row 3 starts under s, and
shift and delete are a letter wide.
- Layouts (#2172): Apple's Add New Keyboard › Czech offers only "QWERTZ –
Czech/Slovak" and "QWERTY – Czech/Slovak" (read through accessibility), so
Czech offers .own ("QWERTZ – Čeština") and .qwerty ("QWERTY – Čeština"),
which is its own rows with Z and Y swapped, both keys kept, as the system
QWERTY variant's keys read.
- The ´ (U+00B4) and ˇ (U+02C7) keys are not dead keys. Observed in Messages
with real touches, every letter followed by each key: each accents the
letter right before it, ´ -> á ć é í ĺ ń ó ŕ ś ú ý ź, ˇ -> č ď ě ľ ň ř š ť ž
and ů after u; capitals too (A´ -> Á, Cˇ -> Č); after anything else (aˇ,
x´, á´, a space, nothing) the key types itself; delete then removes the
accented letter whole. A held ˇ offers ˚, which makes ů and å. CzechTyping
holds these rules; FullKeyboardEngine dispatches Greek's and Czech's
through typeLayoutRules (the file stays under the 1,500-line cap).
- letterHolds: e ě é ê è ę ë ē ė; r ř ŕ; t ť; z ż ź ž; u ú ů û ü ù ū;
i í î ï ì į ī; o ó ô ö ò õ œ ø ō; a á à ą â ä æ ã å ā; s š ß ś; d ď;
l ł ľ ĺ; y ý ÿ; c č ç ć; n ň ñ ń; ˇ ˚. Nothing on ´ or any other key.
Callouts are laid out as the system's (AccentCatalog.arrangement, e.g.
ě e é …). 123/#+= pages and every symbol hold are English's (& § read too).
Autocorrect uses iOS's cs dictionary through the dictionary engine (no typing
model). Missing háčky and čárky are the cheapest fix, however many, as Polish
diacritics are (0.15 plus 0.05 each further one): "cesky" -> "český",
"prilis" -> "příliš". Czech has Latin letters, so it pairs with English for
bilingual autocorrect (#2186), and #2143's any-word partner guard applies.
cs/cs-CZ picks the layout automatically, the space bar says "Čeština", Hex's
next-word lists get Czech entries, and snapshot scenes take
--keyboard-layout cs.
Sentence language in the strip: with two languages the strip interleaved
both languages' candidates whatever the words before were, so a Czech
sentence always showed an English word in a slot. Now a sentence that leans
one language (languageLean, as autocorrect already uses) gets only that
language's candidates, even where it has none: live in Messages, the
simulator's Czech dictionary completed nothing for "ku" after "Příliš
žluťoučký", and English filled the strip with "kurtosis" and "kudos". With no
words before, both languages' in turn, as before. Autocorrect itself is unchanged (#2186: an
English typo in a mixed French sentence is still fixed; a stricter rule broke
testTheFrenchKeyboardFixesEnglishTyposWithEnglishBesideIt, so it was dropped).
Dictation: cs-CZ goes through Apple Speech, never Parakeet (English-only).
macOS 27.2.1 lists cs-CZ for DictationTranscriber only; say -v Zuzana clips
came back with every háček and čárka, numbers as digits ("10 min.", "19:30")
and no punctuation. Dictation follows the keyboard's language (#2164), and
Apple's Settings offers "Add to English (US) Keyboard" for Czech, as for
French; Hex keeps Czech on its own keys beside English, as it does French.
Live (iPhone 17 Pro simulator, Hex's keyboard in Messages, real HID touches):
typed "Příliš žluťoučký kůň" with ´, ˇ and a held ˚.
Verified (iPhone 17 Pro simulator, iOS 27.2, Mac Studio): KeyboardLayoutTests,
FullKeyboardEngineTests, AutocorrectEngineTests, DictationControllerTests and
TranscriptCleanupTests pass (with new Czech cases: rows, layouts, holds,
arrangements, automatic pick, partner, typing "Příliš žluťoučký kůň" through
´ ˇ and a held ˚, the marks' fallbacks, capitals and delete, missing-diacritic
fixes on a stub dictionary, the strip's language order, cs-CZ from
DictationTranscriber, Polished/Casual/Lowercase), and the full HEXMobile
suite passes with the custom-words change on top, rebased on origin/dev
68f18a3 (619 tests, 1 skipped, 0 failures). Rebased onto #2192 (no
clearPendingUndo before a mark's accent, as GreekTyping) and #2199 (Czech's
inputModeLanguage is cs-CZ).
…e strip, and no added capitals in the strip
A TestFlight tester (build 56): "Feat req: custom dictionary for uncommon
programmer slang. Also, even with auto-capitalization off, many suggested
words are capitalized."
What reached the full keyboard before: iOS's text replacements and Contacts
names (requestSupplementaryLexicon -> loadLexicon: a replacement whose phrase
is its shortcut counts as a word). Hex's own custom vocabulary
(CustomVocabularySettings, Settings › Dictation) was dictation only; nothing
in the keys read it.
Custom words (AutocorrectEngine+Vocabulary, setVocabulary):
- The keyboard reads CustomVocabularySettings.terms (the one list dictation
spells with), whether or not dictation's switch is on, at open and on each
settings sync; a bilingual partner gets the same list.
- Its words, and each word of a phrase, join your own words (lexiconTerms):
never autocorrected away, no spelling guesses for them, a different case
put right on space ("github" -> "GitHub"), completed in the strip before
the dictionary's words ("kub" -> "kubectl"), and Swipe typing reads them
(ownWords) and the Spatial decoder (userWords) knows them.
- Settings › Keyboard › Vocabulary (with the full keyboard): how many words,
and a page with the same editor as Dictation's, its footer saying how to
add from the keys. Dictation's editor is unchanged.
- In the keys: hold the strip's left slot (the word you typed) and the strip
offers "Add to vocabulary" in the notice shape (title, "Never
autocorrected", chip). The chip saves it to the App Group and uses it at
once; typing dismisses it. A capital only the sentence's start gave the
word ("Nginx" opening a message) is left out. Without Full Access the
keyboard can't write the App Group, so the word lasts the session.
- New strings with zh-Hans: Vocabulary, its row's two details (one plural),
the page footer, Add to vocabulary, Never autocorrected.
Capitals with Auto-capitalization off, checked on origin/dev (a0a7da5) with
a throwaway test: autocorrect itself was right (#2173: "mondy" -> "monday"),
but the strip still offered "Mandy" (a guess iOS knows capitalised), "I'd"
for "id" (suggest-only contractions), and "Monday" as a completion of "mon".
Now, with it off and nothing typed in capitals, the strip lowercases every
candidate that isn't your own spelling (a vocabulary word, Contacts name,
text replacement, kept word or learned fix), and drops one that becomes what
you typed. Unchanged: sentence and clause starters, which keep "I" and "I'm"
(#2135, testSentenceStartersAndNextWordsFillAllThreeSlots), next words (the
model is lowercase), swipe readings (#2173's swipeCased), and a capital you
typed. AutocorrectEngine stays under the 1,500-line cap: the strip rule,
withoutStrayCapital and previousWord moved, unchanged, to the case-matching
file (AutocorrectEngine+Distance).
Verified (iPhone 17 Pro simulator, iOS 27.2, Mac Studio):
- Full HEXMobile suite, rebased on origin/dev 68f18a3: 619 tests, 1
skipped, 0 failures, with new
AutocorrectEngineTests.testVocabularyWordsAreKeptSpelledYourWayAndCompleted,
testAutoCapitalizationOffSuggestsNoCapitals and
FullKeyboardEngineTests.testSwipeTypesYourVocabularyWords ("kubectl" isn't
swiped before it is in the list, is after).
- Live, Hex's keyboard in Messages with real touches: typed "Nginx" at a
message's start, held the left slot ("nginx" offered), tapped Add to
vocabulary (the App Group then held "nginx" in customVocabulary.terms);
"ngi" then offered "nginx" in the strip, picked it, and "nginx " stayed as
typed. The same with "kubectl" before the rebase.
Settings › Keyboard showed "Vocabulary, 3 words autocorrect keeps and
suggests" and its page, in English and zh-Hans.
R44VC0RP
added a commit
that referenced
this pull request
Nov 21, 2026
…ste, and typing logs off (#2210) * iOS: hold an empty part of the top bar to dictate A tester found the Hex key (44 pt, in the strip) too small to hit quickly. A still hold of 0.4 s (Apple's long press) anywhere on the bar with no word under it now dictates exactly as holding the Hex key does: hold to talk, release to finish. It reuses the Hex key's own path: a HexKeyGesture fed by FullKeyboardView's touches, then the key's press (in-keyboard dictation arms) and hexKeyHeld / hexKeyReleased, so without Full Access it shows the Full Access hint, and a hold that can only open Hex opens Hex, as the key does. The empty space is every touch nothing else takes in the bar: empty slots (their buttons take no touches), the strip around Paste, Undo or a status, the gaps beside the Hex key, and a bar with no suggestions. A word's slot keeps its tap and its hold (Add to vocabulary, #2205). A tap on empty space does nothing, and a slide past 10 pt cancels the hold. No hold while the bar shows the Full Access hint or a notice, while a dictation records or transcribes, or with the emoji panel or style menu up. Typing logs name the source (bar_hold / bar_release). Verified in the iOS 27.2 simulator (iPhone 17 Pro, a UIKit host app, Hex keyboard with Full Access): holding an empty slot showed the recording panel and releasing finished it; holding a suggestion ("The") and tapping empty space did nothing; holds in the 2 pt gap left of the Hex key and past its right edge took the Hex key's path (opened Hex, as the key does once in-keyboard dictation is unavailable). On origin/dev the same hold did nothing. * iOS: Learn how I type is on by default Settings › Privacy › Learn how I type now reads on when the switch was never set (no key in the App Group: true). The toggle saves an explicit false when turned off (UserDefaults.set on change), so "off" and "never set" are distinct and nobody who turned it off is switched back on; no migration is needed. Without an App Group (no Full Access) it stays off, as there is nowhere to learn. Every reader goes through TypingJournalSettings.isEnabled, so both sides follow it: typing (TypingJournal.sharedIfEnabled in the full keyboard) and dictation (the keyboard's DictationEditInference tracking in learnsFromDictation, its learned fixes for in-keyboard dictation, and the app's DictationPipeline fixes and raw-transcript sharing in DictationController). The switch's line now says what it does: "Learns on this iPhone from your taps and the words you fix with Hex, never from what you write elsewhere" (zh-Hans added; the old line is removed from the catalog). Verified: TypingJournalLearningTests.testLearnHowITypeIsOnUntilTurnedOff (an unset switch learns, one turned off stays off and stores nothing) in the full xcodebuild test run. * iOS: the bar's Paste is plain text, centred on the keyboard The clipboard offer drew Paste as a chip (a filled background with a 15 pt corner radius, 12.5 pt medium type) and centred it in the strip's bounds, which leave out the Hex key, so it sat visibly left of the middle. Ryan wanted no chip: plain text in the bar like a suggestion word. - Paste (and Paste dictation) is now SF 17 pt regular in the bar words' ink (palette.stripText), with no background. The clipboard glyph stays, sized to the text's font (small scale), since it sits on the line beside the word. - Paste and the Next keyboard chip (or the pair in a code field) centre on the keyboard's middle, where the middle slot's word centres (KeyboardStripView.barMidX = stripBarFrame.midX in the strip's coordinates), clamped inside the strip. - Their line stays the bar's word line (textCenterY, KeyboardMetrics.stripTextCenter from #2207); the chip and line geometry of #2207 is unchanged. Verified in the iOS 27.2 simulator (iPhone 17 Pro, a copied string through simctl pbcopy): before, the chip spanned x 126-219 pt of a 402 pt keyboard (centre 172); after, glyph and word span 169-232 (centre 201, the keyboard's middle), on the same line as "The" in the middle slot. * iOS: turn Record typing logs off once for everyone The bar's "● Logging" mark shows while Settings › Privacy › Advanced › Record typing logs is on, and Ryan wants it gone. A one-time migration, TypingLogSettings.turnOffOnce, switches the setting off for anyone who has it on and records migrations.typingLogsOff.v1 in the App Group so it never runs again: turning it back on afterwards keeps it on. It runs where either process starts, the app's launch (before the simulator scenes' launch argument) and the keyboard's viewDidLoad (before any typing log session), so a keyboard updated before Hex is opened drops the mark too. The logs already recorded stay, and so does the switch in Settings. Nothing in a build turns it on: the key is set to true only by the switch's consent dialog, the simulator-only --experiment-typing-logs launch argument, and the Settings snapshot fixtures (settings-*-on scenes); no scheme, ci_scripts or Xcode Cloud step passes either, so there was no build or TestFlight default to remove. Verified: TypingLogTests.testTypingLogsTurnOffOnceAndKeepWhatTheyRecorded in the full xcodebuild test run, and in the iOS 27.2 simulator: with experiments.typingLogs set to true and the flag removed from the keyboard's defaults, showing the keyboard left it false and the flag true.
R44VC0RP
added a commit
that referenced
this pull request
Nov 21, 2026
…2218) TestFlight (build 56, iPhone 17 Pro, iOS 27.2.1, English, Auto-capitalization, Autocorrect and Spatial autocorrect on): "Getting random words capitalized". The screenshot reads "Testing how this World" with "working | Works | writing" in the strip. Cause, reproduced on build 56 (2ef08aa) on a Mac Studio simulator (iPhone 17 Pro, iOS 27.2, real HID touches and swipes): Swipe typing read your own UILexicon words with their capitals. With "World" and "Works" as lexicon terms (text replacements whose phrase is the word, which load as Contacts names do), swiping "works" after "testing how this" typed "Works" with "World" in the strip, and "hello world", "i will", "ask mark", "pay the bill", "a rose" swiped as "World", "Will", "Mark", "Bill", "Rose". Typed words were already right on build 56. origin/dev already fixes that report with Auto-capitalization on (#2173, withoutStrayCapital): the same build-56 cases swipe in lowercase on dev, and typed words, completions, Spatial readings and space's fixes keep no stray capital. Two paths were left: - Auto-capitalization off: swipeCased and the strip kept any "own spelling" as stored, so a Contacts name or learned fix that is also a common word still went in capitalised ("testing how this Works i Will" on dev). isOwnSpelling now only counts a capital withoutStrayCapital would keep; text replacement phrases still count as stored. - Your vocabulary (#2205): withoutStrayCapital lowercased a vocabulary word the dictionary knows in lowercase ("Swift" swiped or completed as "swift", while space wrote "Swift"). A word in your vocabulary, spelled as added (isVocabularySpelling), now keeps its capitals in every path. Unchanged: sentence starts and auto-shift, a capital you typed, "I" and its contractions, names the dictionary knows only capitalised ("Kate", "June", "Monday" on space, #2091), German nouns and text replacements. Apple's keyboard (black box, same simulator): typed and swiped "works", "world", "will", "mark", "may", "bill", "rose", "bell" stay lowercase mid-sentence, including with "World", "Works", "Will" and "Bill" as lexicon terms; "june", "monday" and "kate" become "June", "Monday", "Kate" on space. Verified: - xcodebuild test, HEXMobile scheme, iPhone 17 Pro simulator (iOS 27.2): 621 tests, 1 skipped, 0 failures, with new AutocorrectEngineTests.testYourCommonWordsStayLowercaseAndYourVocabularyKeepsItsCapitals and FullKeyboardEngineTests.testSwipedCommonWordsStayLowercaseMidSentenceAndVocabularyKeepsItsCapitals. - Live, this branch in a hosted field with the same lexicon: with Auto-capitalization off, "testing how this works i will hello world" swiped all lowercase (strip lowercase too); with it on, 12 swiped and 13 typed phrases match Apple's casing, sentence starts capitalised.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two TestFlight requests (build 56).
1. Czech keyboard (bc8adad): KeyboardLanguage.czech (Čeština). It matches the standard Czech layout and the system keyboard's observed long-press options: QWERTZ with the ´ and ˇ keys, and Apple's QWERTY – Czech/Slovak variant (#2172). Every key was held with a real touch on the iOS 27.2 simulator. ´ and ˇ accent the letter before them, as the system keyboard does (observed in Messages). Missing háčky and čárky are a cheap autocorrect edit. Dictation in cs-CZ goes through Apple Speech. With two languages, the strip only offers words in the language the sentence is in, so no English completions show in a Czech sentence.
2. Custom words for typing (65dbfd8): Hex's vocabulary list now reaches the full keyboard. Its words are never autocorrected away, are spelled your way, are completed in the strip, and can be swiped. Edit the list in Settings › Keyboard › Vocabulary, or hold a typed word in the strip and tap Add to vocabulary. zh-Hans strings included. With Auto-capitalization off, the strip no longer offers capitals you didn't type ("Mandy", "I'd", "Monday").
The commit messages have the full details, the observations and how each part was verified.
Verified: xcodebuild test, 619 tests, 1 skipped, 0 failures (iPhone 17 Pro simulator, iOS 27.2); generic iOS build with CODE_SIGNING_ALLOWED=NO succeeds. Live in Messages with Hex's keyboard: typed "Příliš žluťoučký kůň", and added and typed a custom word.