The "closest key" logic must be careful not to reveal keys removed by a
modifier.
Must check [_handler.onPointerSwipe] for every candidate values.
[selected_value] is changed back to [selected_direction].
This adds a new bug: When the direction change, the selected value might
not change but a vibration will be triggered anyway.
Since SDK 21, applications can set the background color of the
navigation bar. This is normally simply an item in a theme but it is
more complicated for keyboards.
Modifiers can temporarily remove a key from the layout by returning
'null'.
Make sure pointer handling code handle these modified keys gracefully
and doesn't trigger a key event and a vibration for the removed key.
Handling this event is part of the API but was never done. This caused
unstoppable key-repeat.
This event isn't common, the only way I found on Android 10 is to switch
to the emoji keyboard while holding a key. Some apps might cause this
event more often.
The symbols are now smaller for Shift, Space, Backspace, Delete and
some keys on the bottom row.
The previous rule was to make the text smaller for symbols made of
several characters.
This is changed to a flag approach.
Use the height of the row currently being rendered instead of the base
row size.
Concretely, the bottom row is slightly smaller and will get slightly
smaller text.
Also:
- Rewrite the label rendering code
- Render labels at the middle of the key (was slightly off)
Instead of a fixed size that don't work at all for bigger screens.
Other tweaks:
- Use the value-land dimens to vary 'extra_horizontal_margin'
- Move label size to Config, because it can change at runtime (rotation)
- Slightly decrease the size of "long" symbols
Add a new boolean parameter "edgekeys" for defining keys that have the
additional (swipe) keys on the edges (top, right, left, bottom) instead
of at the corners (top left, top right, bottom left, bottom right).
There were two problems:
- The Action key was swapped when it shouldn't be. The flag
'IME_FLAG_NO_ENTER_ACTION' wasn't interpreted correctly for inputs
that specified both an action and this flag.
- The value 'IME_ACTION_UNSPECIFIED' should remove the Action key.
'keyVerticalInterval' was mistakenly used to compute the height of the
keyboard and the vertical position of keys.
While the code handling pointers did not use this value, the hit box of
the bottom row was shifted by several pixels.
Make sure 'keyVerticalInterval' is only used for rendering and not for
placing the keys.
It is placed on the top-right of the enter key on every layouts.
It sends a special event (performEditorAction) instead of writing a
newline.
The "actionId" is passed through the EditorInfo object in an obfuscated
way so it's not clear whether it's using the right one.
This replaces the "disable accent keys" checkbox.
The default should work for anyone: Accents will be hidden unless the
user has the french language installed.
The value "show every accents" is useful for versions of android that
don't have subtypes.
Fixes:
- Toggling off a modifier was not possible in the corners (eg. accents).
- Modifiers on the same key can't be activated at the same time.
- Characters on the same key as a modifier weren't working properly.
KeyValue defines an ADT and some of its values, it now contains public
final fields and no internal logic.
KeyModifier handles modifiers and accents and creates new instances of
KeyValue when needed.
This operation is now properly cached.
This was a half-finished feature:
- Dangerous when typing passwords
- Caused crash on some devices
- Ugly (on its own but also blinking when sliding and not fixed in size)