Commit Graph

178 Commits

Author SHA1 Message Date
52c0e8c798 Add cyrillic combining kavyka and palatalization (#998) 2025-07-01 23:42:49 +02:00
de5c5b5b60 Sinhala phonetic layout (#965)
Some checks failed
Make Apk CI / Build-Apk (push) Has been cancelled
Check translations / check-translations (push) Has been cancelled
Check layouts / check_layout.output (push) Has been cancelled
Check layouts / Generated files (push) Has been cancelled
2025-04-20 20:05:02 +02:00
60b01927ab Selection mode (#913)
Some checks are pending
Check layouts / Generated files (push) Waiting to run
Check translations / check-translations (push) Waiting to run
* 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-15 16:13:16 +01:00
80c52460c7 Add 'delete_word' and 'forward_delete_word' keys
These keys are the equivalent of ctrl+backspace and ctrl+delete,
respectively.

They can be reached with Gesture+backspace and Gesture+delete
respectively.
2025-03-01 16:52:46 +01:00
55cb5f5315 Make key symbol smaller when 2 characters long or more
This was the case for string keys but not for macros or keys with custom
symbols.
2025-02-28 00:36:14 +01:00
b7d1508d7b Refactor: Remove StringWithSymbol
It's replaced with a macro containing one key.
2025-02-28 00:17:28 +01:00
466e0b8218 KeyValue: Don't wrap keys into a macro when possible
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-27 23:53:42 +01:00
68be82a4f9 Macro keys (#878)
Some checks are pending
Check layouts / check_layout.output (push) Waiting to run
Check layouts / Generated files (push) Waiting to run
Check translations / check-translations (push) Waiting to run
Make Apk CI / Build-Apk (push) Waiting to run
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-23 12:12:29 +01:00
bd5c815a6f Refactor: Cleanup KeyValue flag declarations
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-09 13:13:15 +01:00
06b76d58c2 Fix the compose key being lockable
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-09 13:10:16 +01:00
d3753cc455 Add a glyph for cancelling the compose key
Some checks are pending
Check layouts / check_layout.output (push) Waiting to run
Check layouts / Generated files (push) Waiting to run
Check translations / check-translations (push) Waiting to run
Make Apk CI / Build-Apk (push) Waiting to run
2025-02-08 23:16:18 +01:00
96dabde7c8 Make the left and right keys symbol smaller
Prevents the arrow symbols from colliding with the compose key symbol as
the dpad key is very narrow.
2025-02-08 23:14:01 +01:00
bd1a72d01e Improve the compose key symbol
Make the symbol bolder and slimmer.
2025-02-08 23:14:01 +01:00
0061911ef3 Pressing the compose key exits the pending sequence
Allows stopping a compose sequence without typing anything.
This is also a more intuitive behavior rather than starting a new
sequence.
2025-02-04 15:50:17 +01:00
e3f9341ed1 Refactor: KeyValue: Simplify StringWithSymbol
Some checks failed
Make Apk CI / Build-Apk (push) Has been cancelled
Check translations / check-translations (push) Has been cancelled
Check layouts / check_layout.output (push) Has been cancelled
Check layouts / Generated files (push) Has been cancelled
This removes the Complex key kind and class by making StringWithSymbol a
new kind of key.
2025-01-12 23:24:04 +01:00
3ea5c8d6b7 Refactor: KeyValue: Don't require _payload.equals
Don't require _payload.equals to be implemented (correctly) and avoids
inconsistencies with _payload.compareTo, which is required by type.
2025-01-12 23:10:40 +01:00
bffc76907a Add cursor_up and cursor_down slider keys
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-12 19:16:04 +01:00
1783dcdb35 Refactor: Restrict sliders to new 'Slider' key kind
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-11 16:18:58 +01:00
4f8b5fa6ce Refactor: Make KeyValue payload Comparable
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-11 15:54:24 +01:00
6ce2195253 Add glyphs for zwj and zwnj
Co-authored-by: @srikanban
2025-01-03 15:50:30 +01:00
42c23d3864 Refactor: Simplify double tap for capslock
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-31 12:17:22 +01:00
d9b5b36c27 Null check on the payload of KeyValue
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-28 23:24:03 +01:00
ae50ff2a5c Added tamil layout (#833)
Some checks are pending
Check layouts / Generated files (push) Waiting to run
Check layouts / check_layout.output (push) Waiting to run
Check translations / check-translations (push) Waiting to run
Make Apk CI / Build-Apk (push) Waiting to run
Signed-off-by: Jagadeeshan S <jagadeeshan.s@addverb.com>
2024-12-19 01:05:36 +01:00
2060e6ab07 Add :keyevent key syntax
Allow to add keyevent keys to the keyboard. For example to add a
Play/Pause button:

    :keyevent symbol='⏯' flags='small':85
2024-12-08 11:41:50 +01:00
4eb1f8bd9e Add double grave accent (#779) 2024-12-07 13:16:43 +01:00
de6ee1858b Arabic diacritics (#807)
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-12-05 00:00:51 +01:00
46408572bc font: Use standard symbols for home and end
The glyphs are taken from DejaVuSans, the lines are thickened to improve
readability.
2024-11-16 12:08:36 +01:00
fcbaa23ccf Add "scroll_lock" key (#800)
Added "scroll_lock" equates to KeyEvent.KEYCODE_SCROLL_LOCK
2024-11-11 16:28:59 +01:00
cd2932bde1 Add slavonic combining diacritics
Co-authored-by: Anastazius Kaejatidarjan <zdarian@asu.edu>
2024-10-05 11:28:14 +02:00
8a6dc34b2c Add combining diacritics keys
Co-authored-by: Anastazius Kaejatidarjan <zdarian@asu.edu>
2024-10-04 01:09:51 +02:00
700ec23bd4 Improve Ctrl key labels for Serbian Cyrillic layout
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-29 22:05:54 +02:00
a1be402638 Fix crash with complex keys 2024-09-29 21:59:07 +02:00
9f22e53a3b Add complex keys (#774)
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-29 21:58:22 +02:00
b3d1a3fc1a Add new keyevent "menu" (#726)
* Update ExtraKeysPreference.java

add "menu" to array of extra keys

* Update KeyValue.java

add menu keyevent
2024-07-27 12:00:20 +02:00
2696f42144 Allow extending the compose key (#713)
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-21 23:37:07 +02:00
84e10e0470 Improve zwnj/halfspace symbol and Persian layout (#711)
* 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-21 13:37:01 +02:00
bf3b9c374e Clipboard pane (#681)
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-07-06 22:16:37 +02:00
ecac6a77f8 compose: Compile several starting states
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-06-09 11:52:17 +02:00
46f3b41393 Support the nnbsp character 2024-05-26 00:49:15 +02:00
4906f8105f Circle and round trip gestures (#640)
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-25 21:19:44 +02:00
69ab869079 Hangul support (#595)
* 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-02 20:52:18 +02:00
d96414c6c6 Allow the newline character '\n' in layouts 2024-05-02 19:37:18 +02:00
0f11a88418 More precise and faster spacebar slider (#593)
* 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-05-02 19:31:48 +02:00
78f85e52a2 Fix space key without a symbol
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-04-03 23:59:18 +02:00
e604f6fd57 refactor: Implement Compose without global state
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-18 01:00:22 +01:00
dc3a303af1 refactor: Allow modifier of other key kinds
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-18 00:40:15 +01:00
b33bcd8865 refactor: Use internal flags in Pointers
'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-03-11 00:24:25 +01:00
146d520325 compose: Grey out keys that are not in sequence
Keys that are not in the pending compose sequence are greyed out with
the new 'FLAG_GREYED' flag.
2024-02-17 23:28:31 +01:00
bb60ed9b13 Fix KeyValue flags layout
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-17 23:28:31 +01:00
d56e4d129e compose: Add glyph 2024-02-17 23:28:31 +01:00