| Age | Commit message (Collapse) | Author | Files | Lines |
|
* Refactor: KeyValue constants
Add constants for keys that are accessed from the app's code. This
simplifies the fake pointer handling in Keyboard2View.
* Refactor: Pre-compute action key replacement
The action key and the enter swap are pre-computed in EditorConfig. This
simplifies the code.
|
|
The color of labels on a pressed key that were not the label being
activated (eg. the labels on the corners when activating the label in
the centre) was not correct.
|
|
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.
|
|
|
|
The label size was computed against the width of keys on the keyboard,
which resulted in a different label size on different layouts.
Notably, it made the labels very small on a 11 columns layout and
relatively larger on the numpad.
The label size is now computed against a baseline of 1/10 of the width
of the screen.
|
|
* Fix extra bottom margin when navbar buttons absent
Fix the extra space that was appearing when the gesture-navigation bar
didn't contain the "switch IME" or "close IME" buttons.
This was found on OneUI 7 with the two "keyboard key" related options
turned off.
* Remove unneeded nav bar detection and width computation
|
|
This fixes the unwanted margin at the bottom of the screen on
Samsung One UI 7 based on Android 15.
|
|
The calculation for the size of each rows now avoid making the keyboard
bigger than the screen if the Keyboard Height option is unusually high.
The height calculation with the default settings is changed slightly, it
is now assuming that a layout is 3.95 rows high instead of 4. This is
because the bottom row is usually 0.95% the size of other rows.
|
|
The label size is computed relatively to the width of the keyboard when
the height is larger than 3/2 of the width. This ensures that the labels
have a reasonable size when the keyboard height increases.
|
|
This is due to Paint.setColor overriding any alpha value set with
Paint.setAlpha. Bug was added in 653c598.
|
|
* 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.
|
|
'_marginBottom' might be uninitialized when used.
|
|
This moves some computations that used to be done during onDraw into the
new Theme.Computed class. This also removes Paint objects from the Theme
class, making it data-only.
This is a requirement for making some keys render differently.
|
|
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.
|
|
On API 30 to 34, the status bar changes color when the keyboard appears
and disappears. A ghost of the changed status bar is animated by the
same animation used for the keyboard, which is unexpected.
|
|
These labels are often unwanted and easily collide with other labels.
|
|
The keyboard background now extends under the system bars and display
cutout on Android 15 but the keys do not.
The back and IME switching buttons that appear in the navigation bar require
special care to not overlap with the keyboard.
The launcher and settings activity are also fixed.
|
|
|
|
Bug added in 038f693.
|
|
This was inadvertently changed when the anti-circle gesture was
introduced, which use the same rendering logic.
|
|
Take display cutouts and navigation bars when computing the keyboard
width on SDK >= 30.
|
|
This adds the new 'anticircle' attribute to layouts '<key>' elements
that configure the key to send when doing a anti-clockwise circle
gesture on it.
Labels are drawn the same way as indication.
Updated docs.
|
|
This makes possible to apply other modifiers to mapped keys and ensures
that the modmap really override the shift key behavior.
|
|
'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.
|
|
Shift locked via the "caps lock" key use the "fake pointer" mechanism
that is also used by auto-capitalisation.
Make sure that unlatching a fake pointer do not disabled a locked
modifier.
The implementation is moved into the Pointers class for a safer API and
easier implementation.
|
|
Keys that are not in the pending compose sequence are greyed out with
the new 'FLAG_GREYED' flag.
|
|
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
|
|
|
|
Define the key margin options relative to the baseline dimensions of
keys. This removes the doubling of the horizontal margin in landscape
mode.
|
|
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.
|
|
Removes EmojiBottomRow.
|
|
This reverts commits ef03dfed5c802a855c4655204eee39a8769cfed7 and
ff01678ba688778d67f824a0be56634974c1b0e8.
The "vibration duration" slider is bought back.
The "vibration enabled" option is replaced by "custom vibration", which switch between the system haptic feedback or the custom vibration.
The slider is greyed when "custom vibration" is unchecked and is
allowed to have a value of 0 to disable vibrations within the app.
The intermediate values "light", "medium" and "strong" are removed and
no migration of the setting is made.
|
|
`KeyboardData.getKeys()` now returns a map of the keys present on the
layout to their position. Positions are the row, column and swipe
direction.
The computed map is cached in the KeyboardData object as it might be
accessed later by `findKeyWithValue`, which now do less work.
|
|
Automatic capitalisation might interferes with keyboard shortcuts.
|
|
Several non-string keys can have a large label that shouldn't be elided,
for example ctrl, meta, send.
Also, change the cutoff to 3 characters as labels are easily colliding.
|
|
Make the font smaller for custom keys with a length above 1.
Draw up to 4 characters on keys.
|
|
The newer haptic feedback API that is used instead of the vibrator
service since ef03dfe doesn't work for everyone.
The new vibration option allow to choose both the newer API ("system")
and the older API ("strong", "medium", "light").
|
|
Specify the behavior of shift for a layout. This is intended for locales
that use the same alphabet but have different capital letters (eg.
Bengali).
The modmap is defined like this:
<keyboard>
<modmap>
<shift a="a" b="A"/>
</modmap>
</keyboard>
|
|
The Corner class is removed. The "localized" flag for all the corners is
held in a bitfield.
|
|
'Keyboard.Key' now contains an array of size 9, giving each keyvalue an
index. The algorithm for finding the nearest key during a swipe now
needs 16 segments, which are now calculated as an angle.
The algorithm does one more interation instead of 2 more, slightly
reducing the sensitivity of corner values. The 'getAtDirection' function
is moved into the Pointers class to clearly separate the two systems.
The 'edgekey' attribute is now obsolete but is kept for compatibility.
The flag is removed internally, key index are simply translated.
Similarly, the 'slider' attribute now act on keys at index 5 and 6
instead of 2 and 3.
|
|
Auto-capitalisation triggers when the backspace key is used. Make sure
to not remove a locked shift pointer.
|
|
The 'keysHeight' field needs to be updated. As this class is not
intended to be mutable, copy the list of rows and call the constructor.
Also remove an unecessary component of the keyboard height calculation.
|
|
Refactor. Allows to remove the 'extra_keys' and 'num_pad' flags and to
implement more complicated transformations to the layouts.
|
|
A large margin in portrait mode is desirable but generally not in
landscape mode.
|
|
A separate option is needed, the +25dp offset wasn't enough.
|
|
* Add option for keyboard opacity (transparency). Keyboard background, keys and pressed keys can be adjusted separately.
* Make the borders transparent as well
* Moved setAlphas outside drawKeyFrame to top of onDraw method
|
|
The cancel event ends the motion, it doesn't apply to a single pointer
like it was previously expected.
|