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.
getAtDirection was too hard to maintain and might contain bugs.
Change slightly the meaning of directions and implement a the nearest
key calculation as a loop.
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.
When typing fast, a second key might be pressed before the first is
released.
Clearing modifiers earlier would prevent this but would break modifiers
placed in corners (especially the accent keys). Instead, don't take
latched modifiers into account when registering the second press.
A new flag is needed to not interfere with holding modifers, which is
merged with the norepeat flag.
The required version of fontforge (from 2020!) is not available in many
distros. This is an annoying for contributors and greatly complicated
the CI and F-Droid scripts.
The generated font file is now included in the sources. Fontforge is
still needed when adding new glyphs but this is not a common operation.
Requires two new diacritics: ogonek and dot_above.
The new accents are also added to the Latvian layout as the two language
can be close but not to the other localized layouts. A new mechanism is
needed to reproducibly add extra keys to layouts without manual
placement.
Allow specifying a layout for programming and add a key for switching to
it easily.
The switching key is placed on the top edge of the space bar.
The option has no effect by default because the ergonomic isn't ideal,
it needs to be enabled explicitly.
Users of Latin-script languages certainly prefer to use one layout (for
programming or not). This feature might be removed in favor of a better
language-switching mechanisms in the future.
Revert to previous version, the original google material icon,
which is not rounded, and it looks better with the rest of the keyboard,
also more correct to represent the open box unicode space char,
instead of a smile
The previous computation was very different depending on the device's
screen and accessibility options.
Given that the keyboard is supposed to fill all the space in one
dimension, the dpi unit makes little sense.
The formula doesn't mean anything in particular, it takes into account
both dimensions (x and y) and should be close to the dpi in the
diagonals (which is the direction of swipe).
This changes the actual value, on a 1920x1080 480dpi screen, the value
is increased by 20%.
The accents are taken from the Roboto Regular font (Apache 2.0), added
the dotted circle and exported with FontForge.
The argument to FontForge's Import function are changed, the fifth
argument controls the accuracy and needed to be lowered otherwise the
grave accent wouldn't be rendered at all.
When changing any numeric setting and cancelling this change, the change would not
be persisted, but the summary in the setting screen would show the last position
of the slider instead of the correct unchanged value.
This commit fixes this on the most simple way by resetting the slider position to
the persisted value.
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.
Keep the glyphs in SVG format and build the font using a FontForge
script.
A part of the previous font is kept because the sources is lost.
This adds a new dependency to the build system, fontforge.
On some devices, bogus touch events can be sent while holding a key.
With modulated keys, it can happens on top of other keys.
Ignore every new pointers when a modulated key is pressed.
* Providing a comprehensible Brazilian Portuguese keyboard layout
removed cedille as it is already provided by an independent key;
changed layout to correspond to the locale
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.
* Clicking twice on CTRL or ALT will lock them in 'ON' state
* Make Locking behaviour optional, configurable in preferences
* Nest the new settings into a different page
To avoid spamming the settings page and repetition in the summaries.
Cannot be a popup unfortunately because that would require API >= 11.
* Add Fn and Meta
Co-authored-by: Jules Aguillon <jules@j3s.fr>
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
Before sending a key event while modifiers are active, send events for
the modifier keys.
Some applications don't look at the "metaState" flags but instead keep
track of the up and down events for the modifiers.
For example, the basic text views that are in every applications
correctly handle the "metaState" flags except for one binding:
Selecting text with the arrows while pressing shift.
Change the formula: don't use an external constant, add a state.
It's now the ratio between where the finger is at the first repeat and
where it is now.
Keep the repeat going when swiping into an other key. Currently only for
arrows: It's now possible to go from an arrow to an other without
waiting again for the key repeat timeout.
The backspace and delete keys don't work well with this.
Show these characters only for users that have the corresponding locale
installed (a supported eu language for €, en-GB for £).
Add these characters to most layouts.
Depending on the pixel density isn't ideal for a keyboard, which would
render differently depending on the "scaling" accessibility option.
Landscape mode needs a special values. At the same time, increase the
horizontal margin when landscape.
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).
Currently using the diamond symbol like the history meta key: https://en.wikipedia.org/wiki/Meta_key
However, this key is actually interpreted as the Super/Windows key but
Android calls it "meta" internally.
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.
A customised Latvian specific QWERTY layout (QWERTY (Latvian)) was added
to access all Latvian diacritic characters with a swipe.
Additionally caron, cedille and macron accents were enabled for this
layout.
'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.
Add a "Theme" option to choose between a dark and light theme.
The light theme uses the colors of the dark theme with the luminance
inversed.
The reloading after a configuration change is changed slightly:
- Special handling is needed when the Theme is changed (recreate the views)
- The default implementation of 'onConfigurationChanged' is used
Which triggers more refresh (but don't recreate the views)
- 'onCreateInputView' is no longer needed
API level 12 is required for "subtype" code introduced in 1.7.
This adds a fallback for older version, "subtype" features are not
available but the keyboard is usable.
Changet he minimal version to 4 to be able to query the API level.
Using integer constant for versions because that's how it's presented in
the documentation. Build.VERSION_CODES is WTF.
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.
Remove the use of [getIdentifier] because it requires the current
package name to be passed, which can't be found reliably since the
change in build system.
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)