| Age | Commit message (Collapse) | Author | Files | Lines |
|
* Switch dictionary when language changes
The dictionary was otherwise updated by closing and opening the keyboard
again.
* Refresh suggestions immediately after language switch
|
|
The spacebar autocomplete option was still working even when the
suggestions strip was correctly hidden in applications like Termux.
|
|
* 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.
|
|
This adds dictionary-based spell checking to the keyboard. The keyboard looks at the word being typed and matches it against a dictionary to either complete the rest of the word or find alternative spellings.
The core of this feature is implemented in cdict, which is included as a
submodule in vendor/cidct.
Cdict is developped at https://github.com/Julow/cdict
The dictionaries are hosted at https://github.com/Julow/Unexpected-Keyboard-dictionaries/
The wordlists used to build the dictionaries are the same ones used by
HeliBoard from https://codeberg.org/Helium314/aosp-dictionaries
- Add an activity accessible from the launcher app that lists available
dictionaries with a download button.
The DictionaryListView view shows the list of available dictionaries and
handles downloading and installing them.
- The Dictionaries class manages installed dictionaries. Dictionaries are
installed as individual files into the app's private directory.
- Available dictionaries are listed in dictionaries.xml, which is generated
when building Unexpected-Keyboard-dictionaries.
method.xml mentions the dictionary name for each locales.
|
|
* Refactor: Create subpackage 'suggestions'
* Candidates view: Status message when no dictionary installed
Show a message on the candidates view instead of leaving it empty. A
button points to the dictionary installation activity.
* Add an option to disable the suggestions
* Refactor: Remove Config.should_show_candidates_view
This was moved to EditorConfig.
* Don't disable text suggestions in some text boxes
* Suggestion text size matching settings
The candidates view height is based on the height of keyboard rows and
the suggestion text size is based on the size of labels on the keys.
This is influenced by symbol size and keyboard height options.
|
|
It was possible to define a loop that would crash the app with the
following modmap:
<ctrl a="left" b="left:ctrl,left"/>
With this change, modmap are not taken into account while evaluating
macros. The modmap above modifies ctrl+left into ctrl+left.
|
|
|
|
Currently, refreshing the current word on each key event.
Refreshing is done after a short delay, to ensure the editor has handled
the event.
|
|
The current word is replaced by the pressed suggestion.
|
|
The `CurrentlyTypedWord` class tracks the word that is being typed. It's
implemented on the same model as Autocapitalisation and avoid expensive
IPC calls when possible.
The `Suggestions` class is where the suggestion lookup should go. It
currently just echoes the current word.
|
|
The `CandidatesView` is implemented as a `LinearLayout` that is divided
horizontally with up to 3 `TextView`. It might in the future contain
buttons on the sides.
The candidate view is nested into the input view rather than using
Android's `setCandidatesView` and callbacks as the API is unreliable and
complicated.
The first suggestion goes in the middle to be more accessible. The
second suggestion goes on the right to be more accessible to the
right-handed, because it must go somewhere.
|
|
|
|
* Disable selection mode in text editors
Selection mode removes the space bar key (which is replaced by the Esc
key) and can be annoying in Emacs for example.
Text editor users probably have the `esc` key available.
* Refactor: Move EditorInfo related code to EditorConfig
Add the new EditorConfig class that handles configuration extracted from
the EditorInfo. It is accessible from the Config class for convenience.
This aims at reducing the length of already large classes and group the
code that was spread over several classes.
|
|
This was tested against:
org.godotengine.editor.v3
org.godotengine.editor.v4
|
|
cut and copy with built in keys only if text is selected to keep existing clipboard content. does not work for key combinations like ctrl+x or ctrl+c.
|
|
Emptying the selection with the spacebar slider puts the selection mode
in an unexpected state. This checks that this doesn't happen.
The selection ends can now cross each other, reversing the selection
order. Special care is made to make sure that the sliders go in the
expected direction.
Pointers is changed to send a `onPointerDown` for the first slider event
instead of a `onPointerHold`. This event is detected in
`KeyEventHandler` and the selection ends are reordered if needed when
sliding again.
|
|
* 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.
|
|
* Construct a single handler
* Add a delay after a Keyevent key in a macro
Add a delay before sending the next key to avoid race conditions causing
keys to be handled in the wrong order. Notably, KeyEvent keys handling
is scheduled differently than the other edit functions.
|
|
These keys are the equivalent of ctrl+backspace and ctrl+delete,
respectively.
They can be reached with Gesture+backspace and Gesture+delete
respectively.
|
|
It's replaced with a macro containing one key.
|
|
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
|
|
Set the flag FLAG_SOFT_KEYBOARD when sending key events stops Discord
from sending message when typing Enter.
The other values are the same that are sent when using sendDownUpKeyEvents().
|
|
This removes the Complex key kind and class by making StringWithSymbol a
new kind of 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.
|
|
|
|
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 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.
|
|
* 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.
|
|
The performance characteristics of this function will change in future
plans.
|
|
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.
|
|
Among others:
- Use `apply` instead of `commit` when saving shared preferences.
- Avoid inlined Api
- Remove unused resources
|
|
Moving the cursor with setSelection has no effect on Acode, for which
the fallback must be used.
|
|
This allows to use modifiers in combination with other inputs like a
mouse click, for example under termux-x11.
The key down event and notification about modifiers changing are sent
down to KeyEventHandler. A mutable state remember for which modifier
down events have been sent.
When pressing down a modifier with one finger and typing with the
other, it might appear that the modifier is released after the first
time an other key is pressed and then pressed and released for the
following keys.
This prevents unintentionally type two modified keys instead of one
when the second key is pressed while the other is not yet released.
|
|
|
|
This makes Ctrl+move_cursor the same as before 5123ce5.
|
|
Automatic capitalisation might interferes with keyboard shortcuts.
|
|
The slider was repeatedly sending arrow keys, which change the focused
input when the end of a text box is hit.
A new key is added that implements cursor movements using the
`InputConnection` API.
The new keys are defined as `KeyValue.Editing`, which are no longer only
context menu actions.
The behavior when a selection has started is changed. The selection is
modified instead of cleared even when shift isn't pressed or the
selection would become empty.
Fallbacks to sending arrow keys for editors that do not support the API,
like Termux.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
The most requested keys are undo and redo. Unfortunatly redo doesn't
work reliably.
The other context menu actions like share, assist and autofill are added
even thought they are rarely useful or implemented.
|
|
The "main" layout can now be pin layout. 'SWITCH_TEXT' and
'SWITCH_SECOND_BACK' don't mean to use that.
|
|
|
|
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.
|
|
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.
|