abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/KeyValue.java
AgeCommit message (Collapse)AuthorFilesLines
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.
2024-03-18refactor: Allow modifier of other key kindsJules Aguillon1-1/+13
Allow keys of a kind other than Modifier to be a modifier. This requires writing a compareTo function for KeyValue. Fields are compared in this order: Kind, value, flags, symbol.
2024-03-11refactor: Use internal flags in PointersJules Aguillon1-3/+4
'FLAG_LOCKED' and 'FLAG_FAKE_PTR' are only used within Pointers. Define new flags in Pointers and remove these from KeyValue. Also allows to define new flags.
2024-02-17compose: Grey out keys that are not in sequenceJules Aguillon1-5/+7
Keys that are not in the pending compose sequence are greyed out with the new 'FLAG_GREYED' flag.
2024-02-17Fix KeyValue flags layoutJules Aguillon1-17/+22
The kind field wasn't large enough to hold the new Compose_pending kind. The flags field is reduced in size by removing a free spot. The FLAGS_BITS mask is defined in a safer way.
2024-02-17compose: Add glyphJules Aguillon1-1/+1
2024-02-17Compose keyJules Aguillon1-1/+24
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-01-21Move layout definitions into srcs/layoutsJules Aguillon1-3/+3
This separates the layout definitions from the special layouts (bottom_row, greekmath) and other unrelated files (method, settings). This is also a more intuitive location for layouts and make the resource directory easier to navigate. Under the hood, layouts are copied back into build/generated-resources/xml.
2024-01-15Refactor: Clearer names for CHANGE_METHOD* eventsJules Aguillon1-4/+4
The keys are not renamed to retain compatibility.
2024-01-13Refactor: New namespace for preference classesJules Aguillon1-1/+1
2023-12-30Bring the voice IME chooser with a long pressJules Aguillon1-0/+2
2023-09-03Remove unused editing keys from the settingsJules Aguillon1-2/+3
These keys don't seem to have a purpose, which is confusing.
2023-08-20Refactor: Allow combining diacritics modifiersJules Aguillon1-8/+9
Change the API of `KeyModifier.Map_char` to allow returning a string instead of a single 16 bits char. This allows to return combining diacritics. This also gets rid of `apply_map_or_dead_char`, maps can have their own fallback.