Commit Graph

562 Commits

Author SHA1 Message Date
Nils Brederlow
b3d1a3fc1a
Add new keyevent "menu" (#726)
* Update ExtraKeysPreference.java

add "menu" to array of extra keys

* Update KeyValue.java

add menu keyevent
2024-07-27 12:00:20 +02:00
Jules Aguillon
50a3c0f5bc Fix scaling for layouts with few columns
This was causing a slight padding on the right of 4 columns layouts,
which turned into a large padding when the number row was added.
2024-07-27 00:48:18 +02:00
Jules Aguillon
d8fc4e80e3 Fix crash on Android 6
The call to getLanguageTag() introduced in 4629410 requires API 24.
2024-07-27 00:25:33 +02:00
Jules Aguillon
29b4b665dc Allow Ctrl modmaps in layouts
The 'ctrl' modmap is different from the other modmaps as it also applies
the built-in Ctrl modifier to the resulting character, even if it was
first modified by the custom modmap.

For example, this will map Ctrl+в to Ctrl+V (not to v):

    <ctrl a="в" b="v"/>

This is intended to add keyboard shortcuts in non-latin layouts.

A caveat is that the latin character appears on the keyboard while Ctrl
is activated.
2024-07-25 23:40:58 +02:00
Jules Aguillon
35f35b27be Update ComposeKeyData
Outdated since 6c786f2
2024-07-25 23:23:53 +02:00
asivery
bf2bec0d4b
Revert "latn_qwerty_pl: Consistent placement for ó" (#714)
This reverts commit c5e9e3ff5c.
2024-07-25 23:22:38 +02:00
bokidori
6e1364b5c2
Add Serbian Latin QWERTY layout (#720)
Adds Serbian Latin QWERTY layout. Serbian language uses both Latin and Cyrillic as its official scripts, and this variant should cover anyone from Serbo-Croatian speaking group that uses Latin script.
2024-07-25 23:21:39 +02:00
bokidori
acddd70435
Add Serbian Cyrillic layout (#718)
Adds Serbian Cyrillic layout. Modmap of Fn key allows for desktop-like easier access to actions such as selectAll, copy, paste, etc. This is because, unlike desktop systems, on mobile ctrl does not combine with cyrillic keys to perform actions.
2024-07-25 23:14:30 +02:00
bokidori
6c786f2a1a
Update accent_circonflexe.json (#719)
Allow combining circumflex \u0302 for Cyrillic vowels, enabling users to express themselves accurately.

ја сам са̂м = I am alone
ја сам сам = I am am

да = yes
да̂ = give

код = at
ко̂д = code

Similar to #437 for aigo.
2024-07-25 23:12:55 +02:00
Jules Aguillon
2696f42144
Allow extending the compose key (#713)
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.
2024-07-21 23:37:07 +02:00
Reza Hosseinzadeh
84e10e0470
Improve zwnj/halfspace symbol and Persian layout (#711)
* 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
2024-07-21 13:37:01 +02:00
Jules Aguillon
4629410230 Fix unintended layout used for unsupported languages
The arabic layout was used as the default on devices where all the
installed languages are not supported by the keyboard. This is not
intended.
This is probably caused by 'getCurrentInputMethodSubtype' returning the
first layout in the list of disabled subtypes in alphabetical or
language tag order.
Re-ordering the subtypes in method.xml had no effect.

Setting 'overridesImplicitlyEnabledSubtype' in method.xml has no
measured effect.
2024-07-14 16:15:18 +02:00
Jules Aguillon
b9526d918d Fix crash when using a different script layout
This might happen when using a layout of a different script than the
installed languages.
2024-07-14 15:52:24 +02:00
Jules Aguillon
3164215879 Add locale_extra_keys keyboard attribute
This attribute can be used to disable adding the extra keys from
method.xml.
2024-07-06 23:09:51 +02:00
TadaCZE
cd0f61da74
Add support for Android 12+ dynamic colors (#647) 2024-07-06 22:32:01 +02:00
Jules Aguillon
bf3b9c374e
Clipboard pane (#681)
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.
2024-07-06 22:16:37 +02:00
Jules Aguillon
6021a0b83c Fix crash with narrow layouts
The PreferredPos mechanism cause an out of bound access since 773147a.
2024-07-06 13:34:08 +02:00
Jules Aguillon
bdb080657d Option to disable key repeat
Internally "key repeat" is reword into "long press" when the same
mechanism was used for both features.

The constraint that 'timeoutWhat' must be set to '-1' when no message is
expected has been lifted to simplify the code.
2024-06-30 00:24:39 +02:00
Jules Aguillon
45fc18576e Validate more fields in custom layouts
This adds some errors:

- 'script' or 'numpad_script' is set an empty string.
- Multiple '<modmap>' elements.
- 'shift', 'width' and 'height' on every nodes that support them are
  clamped to a valid value.
2024-06-29 22:48:47 +02:00
Jules Aguillon
66cf643574 Remove 'loc' keys from latn_qwerty_us
Use the "preferred position" feature to place the removed keys
approximately where they were.
2024-06-24 00:07:56 +02:00
Jules Aguillon
6405e5e8be Don't stop keyrepeat after a circle gesture
This was inconsistent with the anticircle and roundtrip gestures.
2024-06-22 23:10:43 +02:00
Jules Aguillon
c01b289eaf Don't change input view when configuration changes
This doesn't seem necessary and won't play well with eventual keys that
change the configuration.
2024-06-16 22:20:14 +02:00
Jules Aguillon
a7b79022e5 Launcher activity: Don't consume events in text field
Allow the keybindings to have an effect in the "Try here" text field.
2024-06-16 22:19:27 +02:00
Jules Aguillon
b5a96dc4dc Option to tweak or disable the circle gesture 2024-06-09 14:25:19 +02:00
Jules Aguillon
944ed32a37 Use preferred dir when placing a key next to an other 2024-06-09 14:03:02 +02:00
Jules Aguillon
773147ab9c Automatic placement of f11/f12 placeholders 2024-06-09 13:55:27 +02:00
Jules Aguillon
52805d9745 Allow to remove keys Tab and Esc 2024-06-09 13:18:25 +02:00
Jules Aguillon
8d793da6b6 Refactor: Remove the KeyModifier cache 2024-06-09 12:49:23 +02:00
Jules Aguillon
91ace060bc Move diacritics mapping to the compose state machine
This replaces the switch cases in KeyModifier.java with JSON files, one
for each diacritic.

The number of states increases from 6727 to 7377. The apk size slightly
decreases (around 3kb).
2024-06-09 11:53:17 +02:00
Jules Aguillon
ecac6a77f8 compose: Compile several starting states
Sequences from several files are no longer merged but compiled to
separate starting states.

The plan is to use that to represent the diacritics.
2024-06-09 11:52:17 +02:00
Jules Aguillon
a886f6eede compose: Fix misbehaving due to encoding errors
Encoding errors in the compose data compiler due to:
- 'UTF-16' adds a BOM, use 'UTF-16-LE' instead
- 'str.encode' returns a byte array, use 'array' to have a 16-bit char
  array.
2024-06-09 10:35:38 +02:00
Jules Aguillon
6ac973cfda Don't cap indication length
This was inadvertently changed when the anti-circle gesture was
introduced, which use the same rendering logic.
2024-06-06 00:30:22 +02:00
Jules Aguillon
c5e9e3ff5c latn_qwerty_pl: Consistent placement for ó
Co-authored-by: @ZX-Commodore-ST
2024-06-05 23:45:03 +02:00
Jules Aguillon
cf1aaa3bdf Add compose sequences for Greek, Cyrillic, Hebrew and more
Parse key names from keysymdef.h, which is distributed with Xorg. The
Greek, Cyrillic and Hebrew sequences referenced these keysyms.

This increases the number of sequences from 2043 to 2668.
2024-05-29 15:56:08 +02:00
Jules Aguillon
39b3f50aa3 Allow compose sequence ending with more symbols
Change the compose state machine definition to allow final states that
are wider than 16-bits.

This increases the number of sequences that can be used from
en_US_UTF_8_Compose.pre from 2013 to 2043 (of 3201).
2024-05-29 15:02:08 +02:00
Jules Aguillon
93d58571cc
Fix overflow due to navigation on the right and cutouts (#641)
Take display cutouts and navigation bars when computing the keyboard
width on SDK >= 30.
2024-05-29 12:00:41 +02:00
Jules Aguillon
1a290f96f2
Configure anticircle gesture per-key (#644)
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.
2024-05-29 11:59:54 +02:00
Jules Aguillon
304375268d Fix uninitialized bottom_row when editing custom layout
This happen when opening the settings from the launcher activity without
ever opening the keyboard.

To remove this bug entirely, the KeyboardData.init method is removed,
the pieces needing initialization are now cached in Config.
2024-05-29 11:56:26 +02:00
Jules Aguillon
9d89297c15 Fix off-by-one error in 1-row layouts 2024-05-27 23:59:09 +02:00
Jules Aguillon
46f3b41393 Support the nnbsp character 2024-05-26 00:49:15 +02:00
Jules Aguillon
abf36e5d56 Add missing characters to hang_dubeolsik_kr 2024-05-25 23:56:35 +02:00
Jules Aguillon
4906f8105f
Circle and round trip gestures (#640)
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.
2024-05-25 21:19:44 +02:00
Quinn Cypher
a91332a903
Pull the emoji list from unicode.org (#612)
- Removing unused information (names and descriptions) from the Emoji class
- Creating a Gradle task that generates a more efficient res/raw/emojis.txt file from the most recent Unicode standard
- Saving recently used emoji preferences as emoji values rather than names
- Migrating old user preferences to the new system
2024-05-08 13:02:19 +02:00
Spike
53e04d5784
Compass-point synonyms for edge keys in layouts (#628) 2024-05-08 12:51:11 +02:00
alotbsol555
c7d33356bc
Add settings button to launcher app (#629) 2024-05-05 11:22:34 +02:00
Jules Aguillon
69ab869079
Hangul support (#595)
* 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
2024-05-02 20:52:18 +02:00
Jules Aguillon
d96414c6c6 Allow the newline character '\n' in layouts 2024-05-02 19:37:18 +02:00
Jules Aguillon
0f11a88418
More precise and faster spacebar slider (#593)
* 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.
2024-05-02 19:31:48 +02:00
alotbsol555
82e0840568
allow for <fn ...> in <modmap> (#626) 2024-05-02 12:09:39 +02:00
Jules Aguillon
c7ed2bcae9 Clear cache when changing layout
Due to the modmap, the cache must be cleared when switching layout to or
from a layout that contain a modmap.

This is broken since 3f6b6fd23, which moves the modmap handling into
KeyModifier.
2024-05-02 12:06:15 +02:00