abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/Keyboard2.java
AgeCommit message (Collapse)AuthorFilesLines
2025-12-22Fix various linting issues (#1146)Jules Aguillon1-3/+0
2025-12-18Disable selection mode in text editors (#1141)Jules Aguillon1-54/+11
* 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-07-30Fix alternate keyboard layouts rendering behind navbar on some devices. (#1062)cillyvms1-0/+1
2025-06-29Add option to also disable number entry layout (#1007)Matej Drobnič1-2/+2
2025-06-29Fix unwanted bottom margin on Samsung OneUI 7 (#1022)Jules Aguillon1-0/+1
This fixes the unwanted margin at the bottom of the screen on Samsung One UI 7 based on Android 15.
2025-05-22Better support for foldable devices (#982)Matej Drobnič1-2/+13
* 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-15Selection mode (#913)Jules Aguillon1-0/+7
* Selection mode: Space to cancel the selection This adds the "selection mode", which is activated when text is selected in the text box. The selection mode is exited when the selection is cleared. While the selection mode is activated, the Space and Esc keys are modified into the "selection cancel" key, which remove the selection without changing the text. The space bar is otherwise easy to type by accident during a selection and causes the selected text to be deleted. * Selection mode: Move each ends of selection separately with slider When the selection mode is activated, the space bar sliders change how they affect the selection: - The left side of the slider moves the left position of the selection. To shrink the selection from the left side, the slider must be activated by sliding to the left, extending the selection temporarilly, then by sliding to the right. - The right side of the slider affects the right position if the selection.
2025-03-10Add a delay after a Keyevent key in a macro (#918)Jules Aguillon1-1/+9
* Construct a single handler * Add a delay after a Keyevent key in a macro Add a delay before sending the next key to avoid race conditions causing keys to be handled in the wrong order. Notably, KeyEvent keys handling is scheduled differently than the other edit functions.
2024-12-28Fix status bar artifact on opens and closesJules Aguillon1-2/+3
On API 30 to 34, the status bar changes color when the keyboard appears and disappears. A ghost of the changed status bar is animated by the same animation used for the keyboard, which is unexpected.
2024-12-26Refactor: Move code to LayoutModifierJules Aguillon1-3/+3
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/+9
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-23Fix crash on devices with only unsupported languagesJules Aguillon1-0/+2
This only affected Android 12 and up.
2024-07-27Fix crash on Android 6Jules Aguillon1-4/+6
The call to getLanguageTag() introduced in 4629410 requires API 24.
2024-07-14Fix unintended layout used for unsupported languagesJules Aguillon1-7/+16
The arabic layout was used as the default on devices where all the installed languages are not supported by the keyboard. This is not intended. This is probably caused by 'getCurrentInputMethodSubtype' returning the first layout in the list of disabled subtypes in alphabetical or language tag order. Re-ordering the subtypes in method.xml had no effect. Setting 'overridesImplicitlyEnabledSubtype' in method.xml has no measured effect.
2024-07-06Clipboard pane (#681)Jules Aguillon1-0/+10
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-16Don't change input view when configuration changesJules Aguillon1-1/+1
This doesn't seem necessary and won't play well with eventual keys that change the configuration.
2024-05-29Fix uninitialized bottom_row when editing custom layoutJules Aguillon1-1/+0
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-02-17Compose keyJules Aguillon1-0/+5
The COMPOSE_PENDING modifier indicate whether a compose sequence is in progress. The new key of kind Compose_pending sets the current state of the sequence. The compose sequences are compiled into a state machine by a python script into a compact encoding. The state of the pending compose is determined by the index of a state.
2024-02-14Don't invert the pin entry layoutJules Aguillon1-2/+8
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 compatibility with Android 3.0Jules Aguillon1-0/+3
Incompatible APIs were used in the custom layouts and the extra keys options. Add @TargetApi annotations to help catch similar issues in the future with the help of 'gradle lint'.
2024-01-15Always show the keyboard switching keyJules Aguillon1-6/+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-15Use switchToNextInputMethod instead of switchToPreviousInputMethodJules Aguillon1-1/+1
This is warranted by the API.
2024-01-15Refactor: Clearer names for CHANGE_METHOD* eventsJules Aguillon1-2/+2
The keys are not renamed to retain compatibility.
2024-01-13Refactor: New namespace for preference classesJules Aguillon1-0/+1
2023-12-30Bring the voice IME chooser with a long pressJules Aguillon1-0/+5
2023-12-30Voice IME chooser popupJules Aguillon1-23/+4
Bring a popup for choosing the voice IME when the voice key is pressed for the first time or the list of voice IMEs installed on the device change. A preference stores the last selected IME and the last seen list of IMEs.
2023-12-26Add layout attribute 'numpad_script'Jules Aguillon1-2/+1
This new attribute is now used instead of 'script' for modifying the numpad according to the selected layout's script. If not provided, it defaults to the value of 'script'.
2023-12-21Fix the number row showing up on top of pinentryJules Aguillon1-0/+2
This wasn't intended and was caused by the "current_layout_unmodified" optimisation.
2023-11-19Separately persisted current layout in landscape modeJules Aguillon1-4/+2
Remember the selected layout in portrait and landscape mode independently. This allows to define a layout specific to landscape without having to switch manually.
2023-11-19Persist current selected layoutJules Aguillon1-11/+10
2023-09-03Per-script numpadJules Aguillon1-4/+12
The numeric layout and the optional right hand side numpad are modified to show the digits belonging to the script used in the current layout. The numpads are still defined as it was before. The digits are changed in `modify_numpad` if needed.
2023-08-16Migrate layouts preferencesJules Aguillon1-1/+1
The new `layouts` preference replaces three previous preferences: layout second_layout custom_layout Add a preference migration function, which first migration is to migrate layouts into the new preference. The migration must also be called from the SettingsActivity as it might use a different preference store due to the boot-aware preference copy.
2023-08-16Allow multiple custom layoutsJules Aguillon1-1/+1
This merges the "Layouts" option with the "Custom layout" option. A custom layout becomes an item in the "Layouts" list among the other layouts. It's possible to add several custom layouts. Selecting the "Custom layout" item in the list opens a second dialog for entering the layout description. Layouts are serialized as JSON object and are decoded solely in the LayoutsPreference class.
2023-08-06Remove the Accents optionJules Aguillon1-14/+4
This option makes less sense since per-script extra keys. It's also getting in the way of an eventual "dead-key or accented-letters" option.
2023-08-06Replace dead-keys when there's one alternativeJules Aguillon1-7/+9
The dead-key is replaced by its alternative if there's only one specified. Extra keys from every subtypes must be merged together to be able to make this check.
2023-08-06Extra keys alternativesJules Aguillon1-3/+2
For each extra key, a list of alternative can be specified. An extra key won't be added to the keyboard if all its alternatives are already present on it. This is useful to avoid having the dead key for an accent and the accented letters at the same time.
2023-07-30Allow more than 2 layoutsJules Aguillon1-29/+22
The two layout selection options are replaced by a ListGroupPreference that allow to enter an arbitrary amount of layouts. The "switch_second" and "switch_second_back" keys are replaced by "switch_forward" and "switch_backward", which allow to cycle through the selected layouts in two directions. Layouts are changed to place these two key on the space bar. The backward key is not shown if there's only two layouts.
2023-07-29Add option to disable pin entry layoutJules Aguillon1-9/+16
The pin entry layout might be inferior for some usecases and people might be more used to the numeric layout.
2023-07-19Refactor: Centralize logging in a static classJules Aguillon1-17/+2
This new class will help write more logs. The LogPrinter is no longer created everytime the keyboard is opened. An error log is added if failing to load the custom extra keys.
2023-06-25Standard layout names (#386)Jules Aguillon1-1/+1
The names are comprised of: script, layout name, country code. Co-authored-by: grim <verdastelo9604@hotmail.com>
2023-06-24Per-script extra keysJules Aguillon1-27/+7
Allows to define a locale's script in 'method.xml' and use that to add the extra keys for a locale to layouts of the same script only. A locale of an undefined script will add its extra keys to every layouts. A layout of an undefined script will have the extra keys of all the enabled locales.
2023-06-10Fix `_localeTextLayout` null on API < 12Jules Aguillon1-11/+8
On API level < 12 or on some rare cases, `refreshSubtypeLayout` was not called, making `_localeTextLayout` uninitialized. This might also happen if `getExtraValueOf` returns an invalid layout name. eg. `method.xml` contains an invalid layout name.
2023-06-03Refactor: Handle Event keys in Keyboard2Jules Aguillon1-60/+69
The `KeyEventHandler` class is intended to handle every keys and to call into the main class through a limited API. However, this is not true for `Event` keys, which in practice had each a corresponding API call.
2023-06-03Hide the voice typing key if no suitable IMJules Aguillon1-19/+26
Implemented similarly to the IM switching key.
2023-06-03Add Voice Typing keyJules Aguillon1-0/+22
The new key switches to any installed "voice" input method. If several input methods matches, no effort is made to choose. Might misbehave with some input methods other than Google's on API < 28. It is placed on the middle of the arrows on the bottom bar. It is enabled by default and can be removed in the "Extra keys" option. The key is not removed from the keyboard if no voice input method exists.
2023-05-24Fix gravity of keyboard in full screen (#363)vladgba1-5/+58
Set keyboard bottom gravity and adjust inputArea height so it doesn't appear on top in fullscreen.
2023-03-28Refactor: Remove unecessary method KeyboardData.load_pin_entryJules Aguillon1-1/+1
2023-02-12Option to switch to the previous input methodJules Aguillon1-3/+13
A new option changes the "change_method" into the new "change_method_prev". It switch to the previously used input method. A long press on "change_method_prev" sends "change_method". A new section is added in the settings and existing options are moved.
2023-01-30Modification step for the special layoutJules Aguillon1-22/+35
Refactor, follow up of 90b7944. Add a modification step to the "special" layouts: numpad, greekmath, pin entry. Remove the apply_key0 function, which is not expressive enough. Add an enum instead of yet an other "switch_" function.
2023-01-30Apply modify_layout to text layout onlyJules Aguillon1-2/+7
Refactor. Allows to remove the 'extra_keys' and 'num_pad' flags and to implement more complicated transformations to the layouts.