* 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.
These keys are the equivalent of ctrl+backspace and ctrl+delete,
respectively.
They can be reached with Gesture+backspace and Gesture+delete
respectively.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
* 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
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.
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.
* 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
* 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.
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.
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.
'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.
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.