abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/Config.java
AgeCommit message (Collapse)AuthorFilesLines
7 daysEmoji suggestion (#1235)Jules Aguillon1-0/+1
Suggest an emoji in addition to the 3 suggested words when the current word matches an alias in the emoji dictionary, if available.
2026-02-19Autocomplete on space bar and undo on delete (#1179)Jules Aguillon1-0/+2
* 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 Aguillon1-3/+3
* 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-02Spell checking (#1137)Jules Aguillon1-8/+10
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 Aguillon1-3/+10
* 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-30Option to switch to the previously used keyboard (#1165)Jules Aguillon1-3/+18
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.
2025-12-28Candidates viewJules Aguillon1-0/+3
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-22Fix various linting issues (#1146)Jules Aguillon1-1/+1
2025-12-18Disable selection mode in text editors (#1141)Jules Aguillon1-6/+3
* 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-09-29Cobalt & Pine theme (#1084)wei lang1-0/+3
2025-09-29Make history duration configurable (#1074)Matej Drobnič1-0/+2
2025-08-24add Everforest Light theme (#1080)Animesh1-0/+1
2025-08-17Slider sensitivity option and improve slider ergonimics (#1070)Jules Aguillon1-1/+2
* Add option 'Space bar slider sensitivity' * Fix slider moving the cursor twice at the beginning The slider was generating two events when first activated. Since 2bed42857. * Make slider less sensitive for the first step This moves the second slider step approximately 40% further and takes the new sensitivity option into account. Allows moving the cursor by one spot more easily.
2025-07-11Use screen width to switch layouts (#1029)Matej Drobnič1-31/+25
This changes layout switching logic to detect screen width rather than increasingly specific portrait/landscape/unfolded state. This reduces number of different auto-layouts back to 2: narrow devices (such as a phone in portrait) and wide devices (such as a phone in landscape or a tablet).
2025-07-06Fix crash with unexpected value in NumberLayout pref (#1036)Jules Aguillon1-1/+1
2025-07-01Fix extra bottom margin when navbar buttons absent (#1024)Jules Aguillon1-3/+0
* Fix extra bottom margin when navbar buttons absent Fix the extra space that was appearing when the gesture-navigation bar didn't contain the "switch IME" or "close IME" buttons. This was found on OneUI 7 with the two "keyboard key" related options turned off. * Remove unneeded nav bar detection and width computation
2025-06-29Add option to also disable number entry layout (#1007)Matej Drobnič1-3/+8
2025-05-30Fix high keyboard height making it overflowsJules Aguillon1-7/+3
The calculation for the size of each rows now avoid making the keyboard bigger than the screen if the Keyboard Height option is unusually high. The height calculation with the default settings is changed slightly, it is now assuming that a layout is 3.95 rows high instead of 4. This is because the bottom row is usually 0.95% the size of other rows.
2025-05-22Better support for foldable devices (#982)Matej Drobnič1-14/+43
* Add AndroidX WindowManager unfortunately, this seems to be the only way to get fold state, native Android APIs are internal. To add this, we need to update some dependencies, raise java version and raise compile SDK. * adds separate layouts and separate layout settings for folded and unfolded state of the device. The affected settings are: + the margin bottom settings + the horizontal margin settings + the keyboard height settings * Update shell.nix
2025-03-27Remove symbols from the number row by default (#964)Jules Aguillon1-3/+11
The number row option is changed into a ListPreference and controls whether the number row contains symbols or not. Co-authored-by: Joey Schaff <j@jaoh.xyz>
2025-02-03Even slower slidedzaima1-1/+1
2025-01-11Make the space bar slider slightly less sensitiveJules Aguillon1-1/+1
2024-12-26Refactor: Move code to LayoutModifierJules Aguillon1-217/+1
Layout modifying functions are removed from Config to LayoutModifier as static classes. The two classes are (weakly) mutually dependent, the refactoring is purely for the purpose of making shorter classes. The only change is that 'modify_numpad' is changed to remove duplicated code. This has the side effect of making the "double tap for caps lock" option affect the shift key in the numpad.
2024-12-26Proper support for Android 15 edge-to-edge (#848)Jules Aguillon1-0/+3
The keyboard background now extends under the system bars and display cutout on Android 15 but the keys do not. The back and IME switching buttons that appear in the navigation bar require special care to not overlap with the keyboard. The launcher and settings activity are also fixed.
2024-12-18Fix crash when opening the numpadJules Aguillon1-5/+12
2024-12-11Move numpad script maps to the compose systemJules Aguillon1-6/+6
This removes the Map_char interface, which required a lot of boilerplate to use.
2024-12-06Persist state of clipboard history checkboxJules Aguillon1-0/+6
2024-10-27Stable extra keys position when number row is addedJules Aguillon1-2/+2
Add the extra keys to the keyboard before the number row is added, as that interferes with the "preferred pos" system.
2024-10-26Rosé Pine Theme (#788)Kalan Walmsley1-0/+1
2024-09-29Add complex keys (#774)Jules Aguillon1-2/+1
This allows to add new kinds of keys that need more data without making KeyValue's footprint bigger for common keys. This changes the [_symbol] field into [_payload], which holds the same as the previous field for more common keys but can hold bigger objects for keys of the new "Complex" kind. This also adds a complex key: String keys with a symbol different than the outputted string. Unit tests are added as the Java language is not helpful in making robust code.
2024-09-21Increase default label size (#747)bokidori1-1/+1
Change default label size to 1.15
2024-07-06Add locale_extra_keys keyboard attributeJules Aguillon1-1/+1
This attribute can be used to disable adding the extra keys from method.xml.
2024-07-06Add support for Android 12+ dynamic colors (#647)TadaCZE1-1/+7
2024-07-06Clipboard pane (#681)Jules Aguillon1-0/+2
This adds the clipboard pane, which allows to save an arbitrary number of clipboards and to paste them later. The key can be disabled in settings. Checking the "Recently copied text" checkbox will cause the keyboard to keep a temporary history of copied text. This history can only contain 3 elements which expire after 5 minutes. If this is unchecked, no history is collected. History entries can be pinned into the persisted list of pins.
2024-06-30Option to disable key repeatJules Aguillon1-0/+2
Internally "key repeat" is reword into "long press" when the same mechanism was used for both features. The constraint that 'timeoutWhat' must be set to '-1' when no message is expected has been lifted to simplify the code.
2024-06-09Option to tweak or disable the circle gestureJules Aguillon1-0/+2
2024-05-29Fix uninitialized bottom_row when editing custom layoutJules Aguillon1-10/+26
This happen when opening the settings from the launcher activity without ever opening the keyboard. To remove this bug entirely, the KeyboardData.init method is removed, the pieces needing initialization are now cached in Config.
2024-05-02More precise and faster spacebar slider (#593)Jules Aguillon1-1/+1
* Make slider speed independent from swipe distance Swipe distances other than the default resulted in a slider that were not easy to control. * refactor: Add class Pointers.Sliding It holds the states and the code needed to make the slider work. 'Pointer.sliding' is set to [null] when sliding is not in progress. The implementation is changed not to depend on [downX] and [dx] but instead use the pointer's [x] coordinate directly. * Move the cursor further for faster slides In sliding mode, compute the speed of the pointer and use it to increase at which the cursor moves. * refactor: Separate kind for cursor movement keys This allows to define a key that moves the cursor more than one position at a time. This will be used to avoid lag during fast slider movements. * Reduce lag when sliding quickly on the spacebar Avoid sending key events in a loop while sliding quickly in a cursor movement key. Key of kind Cursor_move are "multiplied", meaning a single key event represents a movement of more than one position, reducing the number of key events sent. This is only for cursor move keys.
2024-02-28Modify the number row according to the numpad scriptJules Aguillon1-11/+25
The same way as the numpad is modified.
2024-02-28Fix localized numpad outputing wester arabic numbersJules Aguillon1-2/+2
The number keys were constructed in the wrong way: the rendered symbol was correct but not the underlying character that is typed.
2024-02-22Ensure the layout contain the config keyJules Aguillon1-0/+3
Without the config key, the user risk being locked in a custom layout that lacks an escape key like 'switch_numpad', 'change_method', etc..
2024-02-14Don't invert the pin entry layoutJules Aguillon1-0/+21
The pin entry layout shouldn't be inverted as the letter indications would be meaningless and the order would be opposite to what the option specifies. The enter and action key are swapped as the automatic swapping is also removed.
2024-02-10Fix various linter warningsJules Aguillon1-1/+1
Among others: - Use `apply` instead of `commit` when saving shared preferences. - Avoid inlined Api - Remove unused resources
2024-02-10Drop support for Android versions below 3.0Jules Aguillon1-7/+3
Android 3.0 (API level 11) was released in Feb 2011. These versions were already unsupported due to unavoidable calls to: - MotionEvent.getActionMasked() (API 8) And avoidable calls to: - SharedPreferences.Editor.putStringSet() (API 11)
2024-02-10Custom border settings (#524)RetrogisusDEV1-0/+7
2024-01-28Redefined the key margin options in percentJules Aguillon1-9/+6
Define the key margin options relative to the baseline dimensions of keys. This removes the doubling of the horizontal margin in landscape mode.
2024-01-26Send down event for modifiers on timeJules Aguillon1-1/+2
This allows to use modifiers in combination with other inputs like a mouse click, for example under termux-x11. The key down event and notification about modifiers changing are sent down to KeyEventHandler. A mutable state remember for which modifier down events have been sent. When pressing down a modifier with one finger and typing with the other, it might appear that the modifier is released after the first time an other key is pressed and then pressed and released for the following keys. This prevents unintentionally type two modified keys instead of one when the second key is pressed while the other is not yet released.
2024-01-15Always show the keyboard switching keyJules Aguillon1-4/+0
Android's shouldOfferSwitchingToNextInputMethod() method might return false when an other IME is installed, perhaps when the other IME doesn't specify android:supportsSwitchingToNextInputMethod="true".
2024-01-15Refactor: Clearer names for CHANGE_METHOD* eventsJules Aguillon1-1/+1
The keys are not renamed to retain compatibility.
2024-01-13Refactor: New namespace for preference classesJules Aguillon1-1/+4