abouttreesummaryrefslogcommitdiff
path: root/srcs
AgeCommit message (Collapse)AuthorFilesLines
2026-04-24Fix the spacebar in Hangul combining (#1244)Jules Aguillon1-2/+10
* Fix the spacebar in Hangul combining The encoding for the spacebar changed and the Hangul combining code was not updated. * Change the default layout for Korean
2026-04-18Add more symbols to superscript and small_caps (#1198)Jules Aguillon3-272/+331
* Add more symbols to accent_syperscript * Add all uppercase and lowercase variants to accent_small_caps * Use ʁ instead of ᴚ in accent_small_caps
2026-04-16Autocorrect middle word (#1242)Jules Aguillon2-15/+20
* Fix crash when typing space in the middle of a word * Don't trigger autocorrect when the cursor is not at the end of a word This prevented from editing a word that was already typed. * Don't undo autocorrect at the wrong time Backspace was trying to undo autocorrect even after some other action were done after the last autocorrect. This ensures that the keyboard remembers accurately the last action.
2026-04-12Fix crash added in #1233 (#1234)Jules Aguillon1-1/+2
Crash added in https://github.com/Julow/Unexpected-Keyboard/pull/1233
2026-04-12Better spell check with cursor in the middle of a word (#1233)Jules Aguillon3-23/+102
* Better spell check with cursor in the middle of a word Suggestions are based on the entire word and no longer the part of the word just before the cursor. Also, tapping a suggestion or the space bar autocorrect replaces the entire word. * Reduce the number of calls to refresh_current_word While the cursor moves, calls to refresh_current_word are now only done when the cursor exits the current word.
2026-04-12Insert a space when undoing autocorrect (#1232)Jules Aguillon1-1/+2
This prevents the same suggestions to be presented again and autocorrect to be activated again when pressing space. This extra space is wanted because pressing the spacebar triggered autocorrect in the first place.
2026-04-10Better suggestion with diacritics (#1223)Jules Aguillon6-16/+1029
* Update cdict * scripts/subst_of_compose.py: Compute substitutions from compose mappings. They are used when building dictionaries. * Add substitutions compose data * Better suggestion with diacritics This improves the suggestions for words that contain diacritics and uppercase letters. This works by stripping diacritics both when building the dictionaries (using word aliases added in cdict: https://github.com/Julow/cdict/pull/3) and during lookup. Cdict then takes care of resolving the correct word. The substitutions are generated using mappings from `fn`, `shift` and all the `accent_*` modifiers into srcs/compose/substitutions.json This can be updated easily when more mappings are added.
2026-04-10Handle Google Keep bug (#1230)Jules Aguillon2-2/+13
The Google Keep text area sends contradictory flags to keyboards, resulting in the suggestions to be disabled. This seems to be a bug in Google Keep.
2026-04-10Refresh suggestions immediately after language switch (#1229)Jules Aguillon2-0/+8
* Switch dictionary when language changes The dictionary was otherwise updated by closing and opening the keyboard again. * Refresh suggestions immediately after language switch
2026-04-10Dictionary activity: Status message when the keyboard is not enabled (#1228)Jules Aguillon1-0/+3
This shows a reason why the list is empty and removes confusion.
2026-04-10Disable spacebar autocomplete when suggestions are hidden (#1227)Jules Aguillon2-0/+10
The spacebar autocomplete option was still working even when the suggestions strip was correctly hidden in applications like Termux.
2026-04-10Increase lookback when looking for the last word (#1226)Jules Aguillon1-1/+1
For example, typing "dictionarirs" suggests "dictionaries" but moving the cursor away and back results in no suggestion. Because the lookback was 10 characters long, the keyboard was seeing "ctionarirs".
2026-04-05Add Finnish QWERTY keyboard layout XML (#1221)Tony O1-0/+45
2026-03-06Add Assamese layout (#1196)Jules Aguillon1-0/+40
2026-03-06Make layout text editor not redraw every frame (#1192)dzaima1-2/+9
2026-02-27Some slider changes (#1195)dzaima2-10/+25
* Helper for whether a slider is vertical * Only accumulate delta for the current slider's direction * Slow down horizontal cursor movement while ctrl is held
2026-02-25Separate colors for pressed vs activated labels (#1193)dzaima2-1/+4
2026-02-25Add missing alphabet + ~ compose sequences (#1194)dzaima2-152/+166
2026-02-25Update target SDK version to 36 (#1190)Jules Aguillon1-0/+9
* Fix keyboard not showing on Android 16 * Update target SDK version to 36
2026-02-24Fix no keyboard after switching from clipboard manager (#1189)Jules Aguillon1-22/+22
2026-02-24Fix crash introduced in #1183 (#1187)Jules Aguillon1-1/+2
2026-02-22Improve suggestion for capitalized words (#1183)Jules Aguillon1-14/+39
Suggestions were previously case-sensitive, which gave very bad results for the first word of a sentence. This makes sure that the suggestions for capitalized words are as good as for all lower-case words and that the suggestion doesn't turn the uppercase letter into lower case.
2026-02-21Fix space and delete not repeating (#1182)Jules Aguillon1-25/+15
2026-02-19Autocomplete on space bar and undo on delete (#1179)Jules Aguillon7-80/+187
* Refactor: Implement the space key as an editing action The space key is no longer a CHAR key but now an EDITING key. This allows changing the behavior of the space bar while allowing custom layout users to define a key outputing a space as before. KeyModifier and ComposeKey are updated to treat the space key as before. * Enter the best suggestion when the space bar is pressed * Refactor: Implement backspace as an editing action * Undo suggestion when delete is pressed The delete key (backspace internally) undoes the suggestion if the last action done was entering the suggestion with either the space bar or the candidates view. * Add an option to enable space bar autocomplete This option is off by default. Undoing a completion with backspace works in any case. * Refactor: Track selection emptyness in CurrentlyTypedWord This removes an expensive RPC call.
2026-02-19Refactor: KeyValue constants (#1180)Jules Aguillon7-44/+57
* Refactor: KeyValue constants Add constants for keys that are accessed from the app's code. This simplifies the fake pointer handling in Keyboard2View. * Refactor: Pre-compute action key replacement The action key and the enter swap are pre-computed in EditorConfig. This simplifies the code.
2026-02-08Fix label color when keys are pressed (#1173)Jules Aguillon1-1/+1
The color of labels on a pressed key that were not the label being activated (eg. the labels on the corners when activating the label in the centre) was not correct.
2026-02-02Spell checking (#1137)Jules Aguillon12-22/+483
This adds dictionary-based spell checking to the keyboard. The keyboard looks at the word being typed and matches it against a dictionary to either complete the rest of the word or find alternative spellings. The core of this feature is implemented in cdict, which is included as a submodule in vendor/cidct. Cdict is developped at https://github.com/Julow/cdict The dictionaries are hosted at https://github.com/Julow/Unexpected-Keyboard-dictionaries/ The wordlists used to build the dictionaries are the same ones used by HeliBoard from https://codeberg.org/Helium314/aosp-dictionaries - Add an activity accessible from the launcher app that lists available dictionaries with a download button. The DictionaryListView view shows the list of available dictionaries and handles downloading and installing them. - The Dictionaries class manages installed dictionaries. Dictionaries are installed as individual files into the app's private directory. - Available dictionaries are listed in dictionaries.xml, which is generated when building Unexpected-Keyboard-dictionaries. method.xml mentions the dictionary name for each locales.
2026-02-01Candidates view improvements (#1168)Jules Aguillon9-28/+89
* Refactor: Create subpackage 'suggestions' * Candidates view: Status message when no dictionary installed Show a message on the candidates view instead of leaving it empty. A button points to the dictionary installation activity. * Add an option to disable the suggestions * Refactor: Remove Config.should_show_candidates_view This was moved to EditorConfig. * Don't disable text suggestions in some text boxes * Suggestion text size matching settings The candidates view height is based on the height of keyboard rows and the suggestion text size is based on the size of labels on the keys. This is influenced by symbol size and keyboard height options.
2026-01-31Avoid loops in modmaps (#1167)Jules Aguillon2-1/+12
It was possible to define a loop that would crash the app with the following modmap: <ctrl a="left" b="left:ctrl,left"/> With this change, modmap are not taken into account while evaluating macros. The modmap above modifies ctrl+left into ctrl+left.
2026-01-30Option to switch to the previously used keyboard (#1165)Jules Aguillon5-10/+33
The "Switch to the last used keyboard" is renamed to "Switching between input methods" and allows to select "Switch to last used", which was the default in older releases.
2026-01-18Add the small capital letters dead key (#1156)Jules Aguillon5-232/+306
* Add the small capital letters dead key It can be added to the keyboard from the settings or into custom layouts as `accent_small_caps`. Add all the symbols listed on https://en.wikipedia.org/wiki/Small_caps
2026-01-18Refactor: Split DeviceLocales out of Keyboard2 (#1154)Jules Aguillon3-61/+107
* Refactor: Split DeviceLocales out of Keyboard2 This moves the code from Keyboard2 that handles the active IME subtypes and the current one. The goal is to access this information from the dictionary activity while simplifying the code of Keyboard2. * Refresh the candidates view when subtype changes This fixes the status message being inconsistently shown. * Refactor: Load DeviceLocales less often Previously, [DeviceLocales.load()] was called everytime the keyboard was shown on the screen. This operation is moderately costly and only need to be done when the IME subtype changes. * EditorConfig: Fix crash on Android 9
2025-12-28Fix CurrentlyTypedWord counting the first letter twiceJules Aguillon2-4/+4
2025-12-28CurrentlyTypedWord: Handle key eventsJules Aguillon2-7/+46
Currently, refreshing the current word on each key event. Refreshing is done after a short delay, to ensure the editor has handled the event.
2025-12-28CurrentlyTypedWord: Handle selectionJules Aguillon1-12/+23
When selection is entered, the current word is cleared.
2025-12-28Enter the suggestion when it's pressedJules Aguillon3-7/+31
The current word is replaced by the pressed suggestion.
2025-12-28Track the currently typed wordJules Aguillon5-6/+161
The `CurrentlyTypedWord` class tracks the word that is being typed. It's implemented on the same model as Autocapitalisation and avoid expensive IPC calls when possible. The `Suggestions` class is where the suggestion lookup should go. It currently just echoes the current word.
2025-12-28Candidates viewJules Aguillon6-8/+139
The `CandidatesView` is implemented as a `LinearLayout` that is divided horizontally with up to 3 `TextView`. It might in the future contain buttons on the sides. The candidate view is nested into the input view rather than using Android's `setCandidatesView` and callbacks as the API is unreliable and complicated. The first suggestion goes in the middle to be more accessible. The second suggestion goes on the right to be more accessible to the right-handed, because it must go somewhere.
2025-12-26Fix clipboard manager crashes (#1148)Jules Aguillon2-22/+33
* Fix background crash in clipboard history service The clipboard history service might crash when the connection between the keyboard and the system is in a bad state. * Fix race condition in clipboard history service The clipboard history service callback appears to be called concurrently leading to concurrent accesses to data and to concurrent calls to 'on_clipboard_history_change'. Access are now synchronized. * Fix clipboard manager crash when device is locked
2025-12-22Fix various linting issues (#1146)Jules Aguillon9-16/+18
2025-12-18Disable selection mode in text editors (#1141)Jules Aguillon8-118/+157
* Disable selection mode in text editors Selection mode removes the space bar key (which is replaced by the Esc key) and can be annoying in Emacs for example. Text editor users probably have the `esc` key available. * Refactor: Move EditorInfo related code to EditorConfig Add the new EditorConfig class that handles configuration extracted from the EditorInfo. It is accessible from the Config class for convenience. This aims at reducing the length of already large classes and group the code that was spread over several classes.
2025-12-13Added keyboards (#1129)10Develops7-74/+249
* Delete srcs/layouts/armenian_ph_am.xml There is a phonetic layout which is used in old typewriters * Amendments according to GOST 6431-90 * Russian traditional layout cyrl_jiuken.xml * Create cyrl_yawerty.xml Added ЯВЕРТЫ layout * Update cyrl_jcuken_ru.xml Typo fixed * Added QZERTY layout for Italian and Latin
2025-12-13Remove emoji history migration function (#1139)Jules Aguillon2-745/+0
This function was used to migrate the representation of the emoji history and needed a very large table. This reduces the app size by 22KB.
2025-12-13AZERTY: Make sure the accents are available (#1140)Jules Aguillon1-3/+3
Remove the `loc` prefix for important accent dead keys and add ê.
2025-12-13Fix parsing of escaped characters in macros (#1126)Jules Aguillon2-7/+33
* refactor: Better printing for KeyValue in tests * Fix parsing of escaped characters in macros The parsing code was bugged with custom macros like `symbol:\abc` and `symbol:\\abc`.
2025-11-10Fix insets being excluded from computed width (#1127)dzaima1-0/+1
2025-11-01Turkish F layout (#1096)Autissima1-0/+44
2025-11-01Update ComposeKeyData.javaJules Aguillon1-150/+150
Missing from previous commit.
2025-11-01Update extra.json (#1118)Houfalafel1-7/+11
change compose for n͠g to g + n + ~ to avoid overlap. this in order to add n + g = ŋ. also added lowercase Ğ.
2025-09-29Cobalt & Pine theme (#1084)wei lang1-0/+3