abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/KeyValue.java
AgeCommit message (Collapse)AuthorFilesLines
2026-02-19Autocomplete on space bar and undo on delete (#1179)Jules Aguillon1-3/+10
* 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-10/+22
* 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-01-30Option to switch to the previously used keyboard (#1165)Jules Aguillon1-2/+4
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 Aguillon1-1/+8
* 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
2025-12-13Fix parsing of escaped characters in macros (#1126)Jules Aguillon1-4/+29
* 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-07-01Add cyrillic combining kavyka and palatalization (#998)Jules Aguillon1-0/+2
2025-04-20Sinhala phonetic layout (#965)Anton Karmanov1-0/+32
2025-03-15Selection mode (#913)Jules Aguillon1-1/+11
* 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-01Add 'delete_word' and 'forward_delete_word' keysJules Aguillon1-0/+4
These keys are the equivalent of ctrl+backspace and ctrl+delete, respectively. They can be reached with Gesture+backspace and Gesture+delete respectively.
2025-02-28Make key symbol smaller when 2 characters long or moreJules Aguillon1-4/+10
This was the case for string keys but not for macros or keys with custom symbols.
2025-02-28Refactor: Remove StringWithSymbolJules Aguillon1-45/+6
It's replaced with a macro containing one key.
2025-02-27KeyValue: Don't wrap keys into a macro when possibleJules Aguillon1-4/+27
Many kind of KeyValues don't need to be wrapped into a Macro to show a specific symbol. This is especially useful as Macro keys are not affected by modifiers. The parser is changed to have a fast-path when a key value is not a macro.
2025-02-23Macro keys (#878)Jules Aguillon1-13/+51
Add "macro" keys that behave as if a sequence of keys is typed. Macro can be added to custom layouts or through the "Add keys to the keyboard option". The syntax is: symbol:key1,key2,.. The symbol cannot contain a : character. 'key1', 'key2', etc.. are: - 'String with \' escaping' The key will generate the specified string. - keyevent:123 The key will send a keyevent. - The name of any special key
2025-02-09Refactor: Cleanup KeyValue flag declarationsJules Aguillon1-13/+12
Flag 'FLAGS_OFFSET << 8' was incorrectly mentionned as free and the value bits were not taking free flags into account and were bigger than expected.
2025-02-09Fix the compose key being lockableJules Aguillon1-2/+2
The compose key was lockable because it had the flag "FLAG_SPECIAL". Without this flag, the key is not lockable with a long press.
2025-02-08Add a glyph for cancelling the compose keyJules Aguillon1-8/+5
2025-02-08Make the left and right keys symbol smallerJules Aguillon1-2/+2
Prevents the arrow symbols from colliding with the compose key symbol as the dpad key is very narrow.
2025-02-08Improve the compose key symbolJules Aguillon1-1/+1
Make the symbol bolder and slimmer.
2025-02-04Pressing the compose key exits the pending sequenceJules Aguillon1-0/+11
Allows stopping a compose sequence without typing anything. This is also a more intuitive behavior rather than starting a new sequence.
2025-01-12Refactor: KeyValue: Simplify StringWithSymbolJules Aguillon1-60/+23
This removes the Complex key kind and class by making StringWithSymbol a new kind of key.
2025-01-12Refactor: KeyValue: Don't require _payload.equalsJules Aguillon1-10/+6
Don't require _payload.equals to be implemented (correctly) and avoids inconsistencies with _payload.compareTo, which is required by type.
2025-01-12Add cursor_up and cursor_down slider keysJules Aguillon1-1/+5
Implement up and down cursor movement slider. This is not added to any layout yet due to the undesirable behavior when moving the focus out of the text box being edited.
2025-01-11Refactor: Restrict sliders to new 'Slider' key kindJules Aguillon1-12/+34
Setting 'slider="true"' on a key is no longer enough to make a slider, the key must also be of kind 'Slider'. Only the KeyValue that started sliding is now considered, they can be generated with negative values. This allows keys that don't have the complementary cursor movement key on the opposite direction. This will help implement other kind of sliders as well as up/down sliders.
2025-01-11Refactor: Make KeyValue payload ComparableJules Aguillon1-17/+21
and use 'toString()' instead of 'getSymbol()'. This removes unecessary casts when computing symbols and comparing key values. This will make adding other kind of keys easier.
2025-01-03Add glyphs for zwj and zwnjJules Aguillon1-4/+4
Co-authored-by: @srikanban
2024-12-31Refactor: Simplify double tap for capslockJules Aguillon1-5/+5
This doesn't fix a bug but remove some tricky code. The shift key is no longer different when the "double tap for capslock" option is on. The handling of the option is moved to Pointer instead and becomes simpler.
2024-12-28Null check on the payload of KeyValueJules Aguillon1-0/+2
The code expect that the payload is never null but there are now a lot of public constructor functions for KeyValue that don't check for this property.
2024-12-19Added tamil layout (#833)Jagadeeshan S1-0/+14
Signed-off-by: Jagadeeshan S <jagadeeshan.s@addverb.com>
2024-12-08Add :keyevent key syntaxJules Aguillon1-2/+2
Allow to add keyevent keys to the keyboard. For example to add a Play/Pause button: :keyevent symbol='⏯' flags='small':85
2024-12-07Add double grave accent (#779)Zitrone1-0/+2
2024-12-05Arabic diacritics (#807)Jules Aguillon1-0/+14
Add arabic combining diacritics and make them accessible via Fn and Compose combos. Co-authored-by: Anastázius Kaejatídarján <32847759+anaskaejdar@users.noreply.github.com>
2024-11-16font: Use standard symbols for home and endJules Aguillon1-2/+2
The glyphs are taken from DejaVuSans, the lines are thickened to improve readability.
2024-11-11Add "scroll_lock" key (#800)DocJr901-0/+1
Added "scroll_lock" equates to KeyEvent.KEYCODE_SCROLL_LOCK
2024-10-05Add slavonic combining diacriticsJules Aguillon1-0/+11
Co-authored-by: Anastazius Kaejatidarjan <zdarian@asu.edu>
2024-10-04Add combining diacritics keysJules Aguillon1-0/+26
Co-authored-by: Anastazius Kaejatidarjan <zdarian@asu.edu>
2024-09-29Improve Ctrl key labels for Serbian Cyrillic layoutJules Aguillon1-1/+8
Add the ':char' syntax for defining character keys with a different symbol. This new kind of keys is used to implement Ctrl combinations in the Serbian Cyrillic layout without showing latin letters while the Ctrl modifier is activated.
2024-09-29Fix crash with complex keysJules Aguillon1-1/+1
2024-09-29Add complex keys (#774)Jules Aguillon1-19/+123
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-07-27Add new keyevent "menu" (#726)Nils Brederlow1-0/+1
* Update ExtraKeysPreference.java add "menu" to array of extra keys * Update KeyValue.java add menu keyevent
2024-07-21Allow extending the compose key (#713)Jules Aguillon1-1/+1
This allows adding more compose sequences without modifying en_US_UTF_8_Compose.pre. This is done by grouping sequences files that should be merged together into a directory. This also allows moving keysymdef.h into that directory.
2024-07-21Improve zwnj/halfspace symbol and Persian layout (#711)Reza Hosseinzadeh1-1/+2
* Fix persian's half-space invisibility * Add a 0.5 space before ظ in persian * Change the place of چ in persian * Change the width of backspace in persian * Rename zwnj to halfspace in KeyValue.java and beng_provat layout
2024-07-06Clipboard pane (#681)Jules Aguillon1-0/+4
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-09compose: Compile several starting statesJules Aguillon1-1/+1
Sequences from several files are no longer merged but compiled to separate starting states. The plan is to use that to represent the diacritics.
2024-05-26Support the nnbsp characterJules Aguillon1-0/+1
2024-05-25Circle and round trip gestures (#640)Jules Aguillon1-2/+9
This implements clockwise/anticlockwise circle and round trip gestures inspired by Messagease. The circle gestures start after a small threshold to avoid making the regular swipe too hard to aim. The gestures do: - circle: The center symbol with Shift applied, with a fallback on Fn - round trip: Same as the circle gesture but applied to a side symbol - anticlockwise circle: Nothing currently. It is intended to be made configurable per-layout in the future. The new Gesture class keeps track of what the pointer is doing while it moves on a key. It replaces the 'selected_direction' integer.
2024-05-02Hangul support (#595)Jules Aguillon1-2/+49
* Hangul support This works with two new kinds of keys (Hangul_initial and Hangul_medial) that carry a precomposed hangul syllable and act as modifiers. The hangul syllables are composed algorithmically. * Add shift layer to Dubeolsik layout
2024-05-02Allow the newline character '\n' in layoutsJules Aguillon1-0/+1
2024-05-02More precise and faster spacebar slider (#593)Jules Aguillon1-5/+20
* 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-04-03Fix space key without a symbolJules Aguillon1-1/+6
The symbol on the space key was accidentally lost in be97364 when the string "\r" (Java's only way to write "\x0D") was not replaced by "\xE00D".
2024-03-18refactor: Implement Compose without global stateJules Aguillon1-5/+10
Thanks to the previous commit, a modifier key can now be more complex than just a KeyValue.Modifier. This allows a more elegant implementation of the compose key, that could be taken as a base for other features (eg. unicode hex entry, hangul) The COMPOSE_PENDING modifier is removed as keys of kind Compose_pending can act as a modifier. This has the advantage of highlighting the key that was last pressed in the sequence. Rules are added to Pointers: Non-special but latchable keys must clear latches and cannot be locked with a long press. These rules were not needed before but were intended.