Repository navigation
Offer the letter keyboards in alphabetical order - #10
Merged
Merged
Conversation
QWERTY is a poor default for someone who does not touch-type: on a ring of keys walked with two buttons, a scattered alphabet means hunting for every letter. Settings now chooses, beside Flip Orientation and Brightness - "Keyboard: QWERTY" or "Keyboard: ABC". The layouts were already strings, and seedtool_app.c already said why: every key is found by its character rather than by where it sits, so an arrangement is just a different string. Nothing depends on position - the cursor walks a flat ring, the renderer centres each row from the string itself, and layout_key_index searches by character. The alphabetical word layout is 10/9/8 like the QWERTY one, so it fits the three rows the keyboard is drawn in without the renderer knowing them apart. Covers the word keyboard and the passphrase letter pages. The number keyboard has no alphabetical form. The passphrase digit and symbol pages are shared between the two arrays rather than duplicated: punctuation has no alphabetical order, and a second copy would be a second place for a character to go missing. It cannot change mid-session. Settings is reachable only from the Origo menu and the wallet has no row that returns there, so no session can have half a passphrase typed on one arrangement and half on the other. The presses would spell the same string anyway - keys are found by character - but the menu tree makes that structural rather than something the reader has to be careful about. The checks matter more than the feature here, because a layout typed out by hand is exactly where a missing letter comes from, and a missing letter makes some BIP39 words impossible to enter - a reader would reach for a key that is not there and have no way to finish a restore. - layouts_are_complete now takes a layout rather than naming one, and runs over both word arrangements and both passphrase arrays. Each array is checked for full printable-ASCII coverage on its own, not pooled: a character present in only one arrangement is as unusable as a missing one for whoever picked the other. - The Python source-parse test does the same from the source text, and a new one pins both word layouts to exactly the 26 letters. - Both were proved by deleting the "s" from the alphabetical layouts and confirming the self-test and two Python tests fail, naming the letter. Costs 336 bytes, which takes the image to 99.6% of its ceiling with 1184 free - more than the 63 bytes the strings alone suggested, the rest being the second passphrase array, the two accessors and the extra row. The ceiling is close enough now that this is worth saying out loud rather than noting in passing. Verified with the host self-test, 50 Python tests, and a firmware build the audit passes at 300896 bytes. Not yet walked on hardware.
Owner
Author
|
Reverted in 99c2dad — not wanted yet. Diff stays here if it is picked up later. |
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.
Closes #9.
Summary
QWERTY is a poor default for someone who does not touch-type: on a ring of keys walked with two buttons, a scattered alphabet means hunting for every letter. Settings now chooses, beside
Flip OrientationandBrightness—Keyboard: QWERTYorKeyboard: ABC.The layouts were already strings, and
seedtool_app.calready said why: every key is found by its character rather than by where it sits. Nothing depends on position — the cursor walks a flat ring, the renderer centres each row from the string itself, andlayout_key_indexsearches by character. The alphabetical word layout is 10/9/8 like the QWERTY one, so it fits the three rows the keyboard is drawn in without the renderer knowing them apart.Covers the word keyboard and the passphrase letter pages. The number keyboard has no alphabetical form. The passphrase digit and symbol pages are shared between the two arrays rather than duplicated — punctuation has no alphabetical order, and a second copy would be a second place for a character to go missing.
It cannot change mid-session
Settings is reachable only from the Origo menu, and the wallet has no row that returns there, so no session can have half a passphrase typed on one arrangement and half on the other. The presses would spell the same string anyway — keys are found by character — but the menu tree makes that structural rather than something the reader has to be careful about.
The checks matter more than the feature
A layout typed out by hand is exactly where a missing letter comes from, and a missing letter makes some BIP39 words impossible to enter: the reader reaches for a key that is not there and has no way to finish a restore.
layouts_are_completenow takes a layout rather than naming one, and runs over both word arrangements and both passphrase arrays. Each array is checked for full printable-ASCII coverage on its own, not pooled — a character present in only one arrangement is as unusable as a missing one for whoever picked the other.sfrom the alphabetical layouts and confirming the self-test and two Python tests fail, naming the letter.Size
+336 bytes, taking the image to 99.6% of the ceiling with 1184 free. More than the ~63 bytes the strings alone suggested — the rest is the second passphrase array, the two accessors and the extra Settings row. Flagging it rather than burying it: the ceiling is close enough that the next change of any size needs the budget looked at first.
Verified