abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/Keyboard2.java
AgeCommit message (Collapse)AuthorFilesLines
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.
2023-01-15Avoid switching back from secondary layout automaticallyJules Aguillon1-24/+43
Stay on the secondary layout after a config refresh or onStartInputView. The information is kept until the keyboard is restarted. Additionally, move tweaking the secondary layout to the Config class now that physical equality is not needed.
2022-12-29Fix inaccessible text layout from pinJules Aguillon1-2/+2
The "main" layout can now be pin layout. 'SWITCH_TEXT' and 'SWITCH_SECOND_BACK' don't mean to use that.
2022-12-14Fix pin entry layout not showing upJules Aguillon1-0/+2
The regular text layout was showing instead of the pin entry due to a misuse of the 'switch' syntax.
2022-12-14Fix keyboard not showing up after rotationJules Aguillon1-4/+4
'setInputView()' must be called on every 'onStartInputView()', not just when the view is re-created. This is broken since bf31872.
2022-12-11Handle configuration change quicklyJules Aguillon1-25/+31
setInputView() was not called when the view was re-created through refresh_config(). Also, the refresh_config() function was not able to properly set the current layout. Now keep the default layout (_localeTextLayout) and the current non-text layout (if any, _currentSpecialLayout) separately to be able to refresh them later. setInputView() is called everytime the view is created instead of by onStartInputView() specifically. The setting activity now save the preferences to the protected storage in onStop() instead of listening for onSharedPreferenceChanged.
2022-11-26Refactor: Pass layout as a KeyboardData instead of IDJules Aguillon1-23/+20
Parse layouts sooner.
2022-11-26Stop using deprecated 'shouldOfferSwitchingToNextInputMethod'Jules Aguillon1-1/+4
This function has been introduced in API 19 and deprecated in API 28. There was no version check for API 19 but instead of adding these, simply remove the feature for API under 28.
2022-11-13Refactor: Move editing code from to KeyEventHandlerJules Aguillon1-55/+16
Remove the code dealing with InputMethodConnection from 'Keyboard2' and move it into 'KeyEventHandler', where more editing actions can now be implemented. Autocapitalisation is also moved, the IReceiver interface is simplified.
2022-11-13Allow switching quickly between two layoutsJules Aguillon1-8/+8
A new option allow to choose a secondary layout, the switching key is placed on the top edge of the space bar. The "Programming layout" option was basically doing that but it was possible to choose from a few layouts only. It is improved and renamed. The 'LayoutListPreference' allows setting the string for the first entry but otherwise share the rest of the array. Add nice icons from materialdesignicons.
2022-11-11Direct-boot aware preferencesJules Aguillon1-13/+11
Store preferences in device protected storage, which is available before the device is unlocked. The keyboard was crashing when trying to access the encrypted preferences. The emoji pane uses a separate preferences file, the old data is lost. The SettingsActivity can't easily use the new preferences storage. Instead, it continues to use the "default" preferences store, which is copied back to the protected storage when needed.
2022-11-06Enable pin layout for decimal and signed inputsJules Aguillon1-2/+0
Decimal and signed inputs are more common than expected. Adding a few keys is enough to support these.
2022-10-24Add the pin entry layoutJules Aguillon1-4/+17
The layout is used for phone number and datetime input boxes as well as some numbers. It is easier to use when the full numeric layout is not needed.
2022-10-23Add the capslock keyJules Aguillon1-2/+7
The key enable caps lock immediately. It does nothing if caps lock is already enabled. It is not present on the keyboard by default but a place is defined on every layout, top-right of the shift key. It can be enabled in the settings. The icon is from materialdesignicons.com.
2022-10-16Autocapitalisation: Avoid trigerring when Ctrl+DelJules Aguillon1-1/+1
Autocapitalisation could trigger while repeatedly typing Ctrl+Del to remove several words.