Skip to content

Firefox dvorak - Consider adding my layout. Tried to combine some existing ideas...#1247

Open
firefox97 wants to merge 14 commits into
Julow:masterfrom
firefox97:firefox_dvorak
Open

Firefox dvorak - Consider adding my layout. Tried to combine some existing ideas...#1247
firefox97 wants to merge 14 commits into
Julow:masterfrom
firefox97:firefox_dvorak

Conversation

@firefox97

Copy link
Copy Markdown

I included a landscape and left hand only version... Open to thoughts of additions, but I feel like the stock dvorak is almost unusable.
Other Dvorak items
Primarily New Dvorak Layout #1043
But also looked at #1136
And I think Dvorak layout #16

<key c="z" />
</row>
</keyboard>
<row scale="10" height="0.95">

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Builtin layouts shouldn't have a different bottom row.

<key width="1.3" c="backspace" n="delete"/>
<key width="1.3" c="enter" nw="loc voice_typing" ne="action"/>
</row>
<modmap>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Builtin layouts shouldn't have a different modmap. The builtin modmap should work the same on every layouts by default.

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want to add layout variation to the list of layout. Can you post the left hand version to https://github.com/Julow/Unexpected-Keyboard-layouts ?

@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want to add any landscape variation for any layout.
In the future, landscape layouts will be automatically derived from the normal layouts. For now, I don't want to more work on the maintenance side.

<key key0="l" key2="=" key3="+" key4="loc £"/>
<key key0="backspace" key2="delete" width="1.5"/>
<keyboard name="Dvorak" bottom_row="false" script="latin">
<row scale="10">

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This scale attribute is not needed (you'll need to remove it on the other rows as well).

firefox97 added 10 commits May 27, 2026 07:55
DictionaryListView.java now shows all 56 supported languages instead of only those matching your device locale. Any language can be downloaded and installed.

2. Quick dictionary switcher in Settings
DictionaryPickerPreference.java — a new ListPreference under Settings → Suggestions → "Active dictionary". Options: Auto (based on language) + any installed dictionary by display name. Stored as pref key selected_dictionary.

3. Personal dictionary
PersonalDictionary.java — singleton that stores word/replacement pairs in SharedPreferences. Each entry is either:

A plain word (recognized for completions)
A trigger → replacement pair (autocorrect)
Personal dictionary suggestions appear before main-dictionary suggestions.

4. Personal dictionary manager
PersonalDictionaryActivity.java — accessible from Settings → Suggestions → "Personal dictionary". Shows all entries; tap any to edit (word field + replacement field + Delete button).

5. "+" button while typing
A + button appears in the suggestions bar while you're typing a word. Tapping it opens the personal dictionary manager with the current word pre-filled in the add-word dialog. You can then modify both the word (trigger) and the replacement before saving.

The button is wired via CandidatesView.java → set_current_word() which is called by Suggestions.java on every keystroke.
1. Settings crash — The <intent> elements used android:targetPackage="juloo.keyboard2" but the debug build appends .debug to the app ID, so the intent couldn't resolve. Fixed by giving both preferences an android:key and wiring up OnPreferenceClickListener in SettingsActivity.java via wire_activity_pref(), which calls startActivity directly using the class reference (no package string involved).

2. Manage dictionaries language list — The DictionaryListView.java change was already correct; the issue was just that the settings link crashed before you could reach it. After reinstalling the updated build, all 56 languages will appear.

3. "+" button always visible while typing — Fixed in CandidatesView.java: the "No dictionary installed" status view is now inserted before the "+" button in the layout (using addView(view, indexOfChild(_add_word_btn))), so the "+" always sits at the right edge. The "no dict" message also now hides if the personal dictionary has entries (so it won't keep saying "no dictionary" when personal words are in use).
Add it to any keyboard layout XML like this:

<key key0="switch_dictionary"/>
It displays as "¿" (upside-down question mark) — distinctive, small, no font glyphs to add.

How it works
Tapping the key opens a full-width dictionary picker pane that replaces the keyboard view (same pattern as the emoji/clipboard panes). It lists:

Auto (based on language) — the existing locale-derived behavior
One row per installed dictionary, by display name
The currently active dictionary is marked with a ✓ checkmark. Tapping any row immediately:

Writes selected_dictionary to SharedPreferences
Updates _config.selected_dictionary
Calls refresh_current_dictionary() and refreshes suggestions
Returns to the keyboard
The bottom of the pane has a standard keyboard row with an "ABC" key to close and return without changing anything.
…ng.personal_dict_title))

"Add word" is now a clearly visible button in the ActionBar, always accessible at the top right
Back arrow added via setDisplayHomeAsUpEnabled(true) so the user can navigate back
The redundant custom header row is gone — the layout is now just a scrollable list
…he list starts below the ActionBar instead of sliding under it

Single-line entries — word takes the left side (with weight=1), replacement text sits to the right with an ellipsis if it's too long
Narrow left column: Auto/Correct labels + Switch toggle at top, ABC button at bottom
Full-height right column: scrollable dictionary list
Height locked to keyboard height via OnPreDrawListener (no flash)
Dictionary item rows: padding halved, 14sp text
Autocorrect toggle

Switch in the dict picker left column persists to SharedPreferences
Wired to KeyEventHandler.set_space_bar_auto_complete() without resetting other state
switch_dictionary key glyph

New glyph at 0xE01D — ¿ inside a square outline with evenodd cutaway where they intersect
Built via FontForge from srcs/special_font/01D.svg
Key uses FLAG_KEY_FONT | FLAG_SMALLER_FONT
Always-visible + button

+ button stays visible at all times in the candidates bar (not just while typing)
Backspace undo → + button pre-population

Backspace undoing an autocorrect highlights the + button and stores the original/corrected words
_pending_word (original) and _pending_replacement (correction) stored separately from _current_word so they survive the word-tracking reset that fires when cursor lands after the restored space
Both fields persist until the user taps + (which opens PersonalDictionaryActivity pre-filled) or a new autocorrect fires
PersonalDictionaryActivity

Title set correctly; Add word moved to ActionBar options menu
Back navigation via ActionBar home button
Accepts EXTRA_WORD and EXTRA_REPLACEMENT intents for pre-filling both fields
Entry rows: compact single-line horizontal layout (word + → replacement)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants