Compare commits

..

143 Commits

Author SHA1 Message Date
Jules Aguillon
997b7be4c0 launcher: Animated vector describing swipe gesture
Replace the short video with an animated vector image that shows the
swipe gesture.

This is much lighter and reliable than the mp4 video, which failed to
play on many devices.

Source for the image of the key is in inkscape SVG format in srcs/res
and is converted to an android drawable when needed. The swipe animation
is hand-written.
2024-11-18 00:13:08 +01:00
Jules Aguillon
23097921cf Disable automatic Shift when pressing Compose 2024-11-17 11:10:21 +01:00
Jules Aguillon
237c4e2cc2 Automatic Shift should be disabled when pressing Ctrl
This was caused by a programming error.
2024-11-17 11:09:24 +01:00
Jules Aguillon
9bf0a20226 method.xml: Add Australia 2024-11-17 10:38:33 +01:00
Jules Aguillon
354c0a6f1c compose: Add digits to accent_dot_above 2024-11-16 12:23:25 +01:00
Jules Aguillon
46408572bc font: Use standard symbols for home and end
The glyphs are taken from DejaVuSans, the lines are thickened to improve
readability.
2024-11-16 12:08:36 +01:00
Jules Aguillon
0d51f7ea1e Don't apply Fn to space bar left and right
"home" and "end" on the spacebar slider are not useful.
2024-11-16 11:46:43 +01:00
DocJr90
fcbaa23ccf
Add "scroll_lock" key (#800)
Added "scroll_lock" equates to KeyEvent.KEYCODE_SCROLL_LOCK
2024-11-11 16:28:59 +01:00
Jules Aguillon
70365b48d4 Readme: Update link and status for Calculator++ 2024-10-27 11:12:34 +01:00
Jules Aguillon
3c30e8248e Stable extra keys position when number row is added
Add the extra keys to the keyboard before the number row is added, as
that interferes with the "preferred pos" system.
2024-10-27 11:04:05 +01:00
Kalan Walmsley
73742a853f
Rosé Pine Theme (#788) 2024-10-26 00:54:25 +02:00
solokot
24a6dd0f2c
Update Russian translation (#784) 2024-10-19 11:39:40 +02:00
Anastázius Kaejatídarján
2233250e4d
Slavonictajiki (#776)
new layouts for old slavonic and tajik languages
2024-10-05 23:58:42 +02:00
Jules Aguillon
c4a88e4d5b Update compose sequences for Cyrillic
Mainly add sequences for the combining diacritics.

Co-authored-by: Anastazius Kaejatidarjan <zdarian@asu.edu>
2024-10-05 11:39:11 +02:00
Jules Aguillon
cd2932bde1 Add slavonic combining diacritics
Co-authored-by: Anastazius Kaejatidarjan <zdarian@asu.edu>
2024-10-05 11:28:14 +02:00
Zitrone
6fae23a432
compose/accent_*.json: improvements (more accents) (#770)
compose/accent_*.json: improve/complete implementation
compose/shift.json: uppercase for superscript letters & characters without preapplied uppercase versions
2024-10-05 11:06:24 +02:00
Sergiy Stupar
6e2494ca0b
Update Ukrainian translation (#781) 2024-10-05 10:31:39 +02:00
Jules Aguillon
8a6dc34b2c Add combining diacritics keys
Co-authored-by: Anastazius Kaejatidarjan <zdarian@asu.edu>
2024-10-04 01:09:51 +02:00
Jules Aguillon
9f0cf15d2e Add Fn layer and Compose sequences for Cyrillic 2024-09-29 22:47:57 +02:00
Jules Aguillon
700ec23bd4 Improve Ctrl key labels for Serbian Cyrillic layout
Add the ':char' syntax for defining character keys with a different
symbol.
This new kind of keys is used to implement Ctrl combinations in the
Serbian Cyrillic layout without showing latin letters while the Ctrl
modifier is activated.
2024-09-29 22:05:54 +02:00
Jules Aguillon
fb93d841a5 refactoring: safer KeyboardData.load 2024-09-29 22:05:09 +02:00
Jules Aguillon
a1be402638 Fix crash with complex keys 2024-09-29 21:59:07 +02:00
Jules Aguillon
9f22e53a3b
Add complex keys (#774)
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.
2024-09-29 21:58:22 +02:00
bokidori
e309b76c0a
Increase default label size (#747)
Change default label size to 1.15
2024-09-21 23:30:01 +02:00
Mostafa Khorashadi Zadeh
4d686a8836
Change the place of چ and ژ in Persian Keyboard Layout (#757)
* Change place of "چ" and "ژ"

* rollback unexpected changes
2024-09-21 11:33:59 +02:00
Zitrone
b21bf3fffd
Improve bone layout (#748)
* shell.nix: fix gradle error

error was:
> \> Task :compileDebugJavaWithJavac FAILED
> error: Source option 7 is no longer supported. Use 8 or later.
> error: Target option 7 is no longer supported. Use 8 or later.

fixed by overriding the jdk version for gradle to openjdk17

* layouts/latn_bone: fix layout

- fix alignment with tabs mess
- make like actual bone layout, instead of trying to fit it into a 10 key
  wide keyboard
  - fixes missing üäö
  - fix missing $
  - moves q and ß where they belong
  - remove all of the diacritic keys (they can be added through the
    settings as extra keys)
  - kept the number row extra keys integration into top row
  - kept the idea of compressing , and . into the swipe actions of the
    bottom row
  - kept the number keys as key4 in the layer4 positions (instead of
    moving them to a number row, which i also considered)
2024-09-19 23:57:26 +02:00
Spike
7454389f48
doc: Point to code for built-in bottom row and number row for use as starting points (#756) 2024-09-19 23:48:56 +02:00
Jules Aguillon
b61e9db21e compose: Deduplicate end states
Make compose sequences ending in the same character to share the ending
state.
This reduce the compiled compose key data size from 33kB to 27kB.
2024-09-14 15:13:04 +02:00
Jules Aguillon
24d6b96ad7 Add Serbian to method.xml 2024-09-14 14:28:56 +02:00
Jules Aguillon
13ad05c0b0 doc: Mention switch_clipboard 2024-09-14 14:26:34 +02:00
Jules Aguillon
a8e331c322 Define the Shift modifier using the compose mechanism 2024-09-10 22:50:39 +02:00
Jules Aguillon
b600332595 Define the Fn modifier using the compose mechanism
This removes 100Kb from the app.
2024-09-10 22:43:40 +02:00
Jules Aguillon
e734d1d0e2 compose: Allow c-style comments in json files
Useful to manager growing the collection of sequences.
2024-09-10 22:43:05 +02:00
Jules Aguillon
c57ae83bfa Compose sequences can end in internal key names
This adds the '\n' and '\t' sequences to showcase the new feature.
2024-09-10 22:16:49 +02:00
Jules Aguillon
c886a89b11 Update autocapitalisation on Enter 2024-09-10 21:53:52 +02:00
cknight828
231c08eb97
Add Japanese translation and layout (#743) 2024-09-08 15:46:38 +02:00
IYO-OYI
4eca9caec1
Update Korean translations (#737) 2024-08-24 23:43:42 +02:00
Spike
bc8fef11f1
Modmap: Reorganize (#730)
Put new example in Examples section; put all overview material at start; use "modmap" for the modmap tag but "mapping" for the various subtags; set out each subtag separately; stop illustrating example mappings as complete modmap.
2024-08-18 21:49:30 +02:00
Jules Aguillon
4d0598a011 Fix crash when clipboard contains an image 2024-08-18 21:24:32 +02:00
Jules Aguillon
038f693cae Update target SDK version to 35 2024-07-28 23:07:05 +02:00
bokidori
72d88a5298
Map Fn+Cursor_move to home/end (#728)
Fn modifier switches cursor_left to home key, cursor_right to end key
2024-07-28 21:29:50 +02:00
Jules Aguillon
bd50964651 Release 1.29.1 (42) 2024-07-27 12:35:59 +02:00
Adrian
105a5a2f33
Added supported key for avoiding the pain of auto-caps (#725) 2024-07-27 12:27:05 +02:00
bokidori
62530e98b9
Update cyrl_lynyertz_sr.xml (#727)
Include comprehensive ctrl modmap, enabling the use of ctrl modifier with Serbian Cyrillic keys. Remove clunky fn modmap previously used for just a few actions such as cut/copy/paste/etc.
2024-07-27 12:17:40 +02:00
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
9d76227982 check_layout.py: Handle compass-point attributes 2024-07-26 00:10:54 +02:00
Jules Aguillon
3967fb8a9f doc: Document the <ctrl /> modmap 2024-07-26 00:04:57 +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
65f4ffd15b method.xml: Remove overridesImplicitlyEnabledSubtype
This was hoped to fix a random layouts to be shown by default to users
of unsupported languages. This breaks language switching using the
system dialog.
2024-07-20 12:20:24 +02:00
Jules Aguillon
deb611a0d2 Release 1.29.0 (41) 2024-07-15 00:21:59 +02:00
solokot
29f03d0e96
Update Russian translation (#702) 2024-07-14 16:55:34 +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
Mehmet Ali
db3b021bfc
Update Turkish Translations (#699) 2024-07-13 11:16:06 +02:00
Spike
3862f4d6ba
doc: Re-add text for better overview (#697) 2024-07-10 22:47:58 +02:00
Edgars
555ede0fee
Add missing Latvian translations (#698) 2024-07-09 19:36:05 +02:00
Spike
7b90294b57
Clerical edits related to locale_extra_keys (#696)
* Post-edit on Metadata

① Tell reader exactly what to type to disable locale_extra_keys, as with prev. bullet
② Values should be quoted
③ Rephrase one passive

* locale_extra_keys obviates 2nd example under modmap
2024-07-08 22:45:11 +02:00
Spike
69881e75c7
Update Spanish translations (#695) 2024-07-08 00:17:16 +02:00
Chasm Solacer
533e22ab4f
Update Polish translation (#691) 2024-07-07 14:21:35 +02:00
Sergiy Stupar
46c86a05bd
Update Ukrainian translation (#692) 2024-07-07 14:21:03 +02:00
Validbit
e053d4b20c
Update Czech strings.xml (#693) 2024-07-07 14:20:13 +02:00
polyctena
c1e19a21d0
Update values-de/strings.xml (#694) 2024-07-07 14:19:33 +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
Jules Aguillon
99367a9ec6 Update French translations 2024-07-06 22:42:56 +02:00
TadaCZE
cd0f61da74
Add support for Android 12+ dynamic colors (#647) 2024-07-06 22:32:01 +02:00
Jules Aguillon
ce57b5a4a2 Make the emoji and clipboard bottom rows consistent 2024-07-06 22:19:34 +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
solokot
89d0e6c063
Update Russian translation (#689) 2024-07-06 11:15:49 +02:00
Jules Aguillon
a2eea76e70 doc: Clarify the possible key values 2024-07-03 00:35:25 +02:00
Sergiy Stupar
2cb5e67d1f
Update Ukrainian translation (#682) 2024-06-30 14:02:56 +02:00
Jules Aguillon
3a371c354b doc: Correct mentions of gestures 2024-06-30 00:46:25 +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
bf33230c26 settings: Reword "Key repeat" into "Long press"
The long press timeout is used for long press on keys that do not
repeat, for example the keyboard switching key.

This must be detached from the key repeat as it might be disableable in
the future and more keys might be longpressable.
2024-06-30 00:06:17 +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
b432f1d773 Set preferred position for Norwegian extra keys
This should make the QWERTY (US) layout look the same to Norwegian users
as the current latn_qwerty_no layout, allowing it to be changed.
2024-06-24 00:14:26 +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
Spike
ada3b5f3b7
doc: Where to put <modmap> (#666)
* Modmap: Where to put it; cancelling built-in mods (#665)

* Correct per Julow: not only Euro layouts

* Post-edit: Doesn't depend on "built-in" layout

* P-vs-L: Change "That is to say", sentence is not a restatement

* Discussion with Julow: Swipe graphic to HTML; at most one modmap

* Swipes: Center tables
2024-06-22 23:27:29 +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
Sergiy Stupar
460f25317f
Update Ukrainian translation (#670) 2024-06-16 22:39:44 +02:00
alotbsol555
81d1a1a831
Update German translations (#667) 2024-06-16 22:39:26 +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
bad2e8c237 Refactor: Remove unecessary view in emoji pane 2024-06-16 22:19:20 +02:00
solokot
b7be19dc1f
Update Russian translation (#656) 2024-06-11 00:54:19 +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
1197ce36b4 Update check_layout.output 2024-06-08 22:47:55 +02:00
Spike
8b99c04a21
Flesh out custom layout doc (#651) 2024-06-08 22:22:46 +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
f7f1d85f80 Release 1.28.0 2024-05-29 14:08:27 +02:00
Jules Aguillon
5d2eb35574 Increase target SDK to 34 2024-05-29 14:04:14 +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
bea2e6cd1f Update check_layout.output
Was outdated since previous commit
2024-05-26 00:20:36 +02:00
Jules Aguillon
abf36e5d56 Add missing characters to hang_dubeolsik_kr 2024-05-25 23:56:35 +02:00
JapanYoshi
c9b6380ed0
Add custom layout documentation in doc/ (#643) 2024-05-25 22:22:42 +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
NACAMURA Mitsuhiro
96fc4003f1
Update NixOS wiki link (#633) 2024-05-12 10:53:04 +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
JapanYoshi
5386541db3
Add more accented characters to KeyModifier.java (#622) 2024-04-25 13:24:52 +02:00
复予
94b2ded843
Update Simplified Chinese translation (#617) 2024-04-24 13:31:29 +02:00
JapanYoshi
2684d1f041
Turkish: Correct shift behavior for ı and i (#615) 2024-04-19 14:38:35 +02:00
Jules Aguillon
78f85e52a2 Fix space key without a symbol
The symbol on the space key was accidentally lost in be97364 when the
string "\r" (Java's only way to write "\x0D") was not replaced by
"\xE00D".
2024-04-03 23:59:18 +02:00
Tomasz Cielecki
5e3a3f894b
Add Danish layout (#606) 2024-04-03 23:46:39 +02:00
Jules Aguillon
3f6b6fd232 refactor: Apply the modmap in KeyModifier
This makes possible to apply other modifiers to mapped keys and ensures
that the modmap really override the shift key behavior.
2024-04-01 23:01:21 +02:00
Jules Aguillon
f17afba7be sync_translations: Fix store descrs not updated 2024-03-24 21:37:41 +01:00
marciozomb13
7e9d8c73df
Update pt-BR translations (#598) 2024-03-24 21:36:55 +01:00
Benson Muite
b22b49d3e6
launcher: Grammar fixes (#599) 2024-03-24 21:36:18 +01:00
Lev Brekalov
7c3286078b
Add Shaw Imperial layout (#592) 2024-03-23 00:06:23 +01:00
Jules Aguillon
e604f6fd57 refactor: Implement Compose without global state
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.
2024-03-18 01:00:22 +01:00
Jules Aguillon
dc3a303af1 refactor: Allow modifier of other key kinds
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.
2024-03-18 00:40:15 +01:00
Jules Aguillon
ec8e78d5cc refactor: Use Pointers.Modifiers.has less
The performance characteristics of this function will change in future
plans.
2024-03-18 00:09:32 +01:00
Jules Aguillon
0549c6c8a1 Fix potential out of bounds access
The preferred pos mechanism could cause an out of bounds access on 1 row
layouts.
2024-03-16 23:42:37 +01:00
Jules Aguillon
e74b45c2d6 Move fastlane metadata into fastlane/metadata/android 2024-03-16 23:37:38 +01:00
296 changed files with 13397 additions and 5760 deletions

View File

@ -14,7 +14,7 @@ Python 3 is required to update generated files but not to build the app.
For Android Studio users, no more setup is needed.
For Nix users, the right environment can be obtained with `nix-shell ./shell.nix`.
Instructions to install Nix are [here](https://nixos.wiki/wiki/Nix_Installation_Guide).
Instructions to install Nix are [here](https://wiki.nixos.org/wiki/Nix_Installation_Guide).
If you don't use Android Studio or Nix, you have to inform Gradle about the
location of your Android SDK by either:
@ -180,7 +180,7 @@ the file and the English strings.
To check that `strings.xml` is formatted correctly, run
`python sync_translations.py`. This will modify your files.
Store descriptions in `metadata/` are updated automatically.
Store descriptions in `fastlane/metadata/android/` are updated automatically.
Translating changelogs is not useful.
The app name might be partially translated, the "Unexpected" word should remain
@ -190,6 +190,12 @@ As translations need to be updated regularly, you can subscribe to this issue
to receive a notification when an update is needed:
https://github.com/Julow/Unexpected-Keyboard/issues/373
### Adding Compose key sequences
New Compose sequences can be added into `srcs/compose/compose/extra.json`.
If a entirely new family of sequences were to be added, a new `.json` file can
be created in the same directory to host them.
### Adding key combinations
Key combinations are defined in `srcs/juloo.keyboard2/KeyModifier.java`.

View File

@ -20,12 +20,12 @@ This application contains no ads, doesn't make any network requests and is Open
Usage: to apply the symbols located in the corners of each key, slide your finger in the direction of the symbols. For example, the Settings are opened by sliding in the left down corner.
| <img src="/metadata/android/en-US/images/phoneScreenshots/1.png" alt="Screenshot-1" /> | <img src="/metadata/android/en-US/images/phoneScreenshots/2.png" alt="Screenshot-2"/> | <img src="/metadata/android/en-US/images/phoneScreenshots/3.png" alt="Screenshot-3"/> |
| <img src="/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png" alt="Screenshot-1" /> | <img src="/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png" alt="Screenshot-2"/> | <img src="/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png" alt="Screenshot-3"/> |
| --- | --- | --- |
| <img src="/metadata/android/en-US/images/phoneScreenshots/4.png" alt="Screenshot-4" /> | <img src="/metadata/android/en-US/images/phoneScreenshots/5.png" alt="Screenshot-5" /> | <img src="/metadata/android/en-US/images/phoneScreenshots/6.png" alt="Screenshot-6" /> |
| <img src="/fastlane/metadata/android/en-US/images/phoneScreenshots/4.png" alt="Screenshot-4" /> | <img src="/fastlane/metadata/android/en-US/images/phoneScreenshots/5.png" alt="Screenshot-5" /> | <img src="/fastlane/metadata/android/en-US/images/phoneScreenshots/6.png" alt="Screenshot-6" /> |
## Similar apps
* [Calculator++](https://github.com/Bubu/android-calculatorpp) - Calculator with a similar UX, swipe to corners for advanced math symbols and operators. Works up to Android 13 but maybe unmaintained.
* [Calculator++](https://git.bubu1.eu/Bubu/android-calculatorpp) - Calculator with a similar UX, swipe to corners for advanced math symbols and operators.
## Contributing

Binary file not shown.

View File

@ -2,25 +2,33 @@ plugins {
id 'com.android.application' version '8.1.1'
}
dependencies {
testImplementation "junit:junit:4.13.2"
}
android {
namespace 'juloo.keyboard2'
compileSdk 33
compileSdk 34
defaultConfig {
applicationId "juloo.keyboard2"
minSdk 11
targetSdkVersion 33
versionCode 39
versionName "1.27.0"
targetSdkVersion 35
versionCode 42
versionName "1.29.1"
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['srcs']
java.srcDirs = ['srcs/juloo.keyboard2']
res.srcDirs = ['res', 'build/generated-resources']
assets.srcDirs = ['assets']
}
test {
java.srcDirs = ['test']
}
}
signingConfigs {
@ -84,9 +92,6 @@ android {
}
}
dependencies {
}
tasks.register('buildKeyboardFont') {
println "\nBuilding assets/special_font.ttf"
mkdir "$buildDir"
@ -103,6 +108,14 @@ tasks.register('buildKeyboardFont') {
}
}
tasks.register('genEmojis') {
println "\nGenerating res/raw/emojis.txt"
exec {
workingDir = projectDir
commandLine "python", "gen_emoji.py"
}
}
tasks.withType(Test).configureEach {
dependsOn 'genLayoutsList'
dependsOn 'checkKeyboardLayouts'
@ -143,7 +156,7 @@ tasks.register('compileComposeSequences') {
println "\nGenerating ${out}"
exec {
def sequences = new File(projectDir, "srcs/compose").listFiles().findAll {
it.name.endsWith(".pre") || it.name.endsWith(".json")
!it.name.endsWith(".py") && !it.name.endsWith(".md")
}
workingDir = projectDir
commandLine("python", "srcs/compose/compile.py", *sequences)

View File

@ -1,10 +1,9 @@
# arab_alt
Layout includes some ASCII punctuation but not all, missing: !, ", ', +, -, /, :, ;, <, =, >, ?, [, \, ], _, |, ~
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
2 warnings
1 warnings
# arab_hamvaj_tly
Layout includes some ASCII punctuation but not all, missing: ", %, ', ,, /, ;, <, =, >, ?, [, \, ], _, `, {, |, }
Layout doesn't define some important keys, missing: esc, f11_placeholder, f12_placeholder
Layout doesn't define some important keys, missing: loc esc
2 warnings
# arab_pc
Layout includes some ASCII punctuation but not all, missing: !, ', +, ;, ?, \, |
@ -19,43 +18,50 @@ Layout includes some ASCII punctuation but not all, missing: !, ', +, ;, ?, \, |
Layout includes some ASCII punctuation but not all, missing: ", %, ', ,, /, ;, <, =, >, ?, [, \, ], `, {, |, }
1 warnings
# armenian_ph_am
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
1 warnings
0 warnings
# beng_national
Layout includes some ASCII punctuation but not all, missing: $
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
2 warnings
1 warnings
# beng_provat
Layout includes some ASCII punctuation but not all, missing: $, &, *, ., /, <, >, [, \, ], `, {, |, }
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
2 warnings
1 warnings
# cyrl_jcuken_ru
0 warnings
# cyrl_jcuken_uk
0 warnings
# cyrl_lynyertz_sr
0 warnings
# cyrl_ueishsht
0 warnings
# cyrl_yaverti
Layout includes some ASCII punctuation but not all, missing: ~
1 warnings
# cyrl_yqukeng_tj
Layout doesn't define some important keys, missing: loc esc, loc tab
These keys are now added automatically, unexpected: f11_placeholder, f12_placeholder
2 warnings
# cyrl_yxukeng_os
Layout includes some ASCII punctuation but not all, missing: ", #, $, &, ', @, [, ], ~
Layout doesn't define some important keys, missing: loc esc, loc tab
These keys are now added automatically, unexpected: f11_placeholder, f12_placeholder
3 warnings
# deva_alt
Layout includes some ASCII punctuation but not all, missing: #, $, %, &, ', (, ), +, ., /, :, <, =, >, [, \, ], ^, _, `, {, |, }, ~
Layout doesn't define some important keys, missing: esc, f11_placeholder, f12_placeholder, tab
Layout doesn't define some important keys, missing: loc esc, loc tab
2 warnings
# deva_inscript
Duplicate keys: ।
Layout includes some ASCII punctuation but not all, missing: ", $, ', ^, _, `, |
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
3 warnings
2 warnings
# grek_qwerty
Duplicate keys: ;
1 warnings
# guj_phonetic_in
Duplicate keys: ટ, ડ
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
2 warnings
1 warnings
# hang_dubeolsik_kr
0 warnings
Layout doesn't define some important keys, missing: loc esc, loc tab
1 warnings
# hebr_1_il
Layout includes some ASCII punctuation but not all, missing: (, ), <, >, [, ], {, }
1 warnings
@ -65,11 +71,10 @@ Layout includes some ASCII punctuation but not all, missing: (, ), <, >, [, ], {
# latn_azerty_fr
0 warnings
# latn_bepo_fr
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
1 warnings
0 warnings
# latn_bone
Layout includes some ASCII punctuation but not all, missing: $
Layout redefines the bottom row but some important keys are missing, missing: cursor_left, cursor_right, loc compose, loc end, loc home, loc page_down, loc page_up, loc switch_greekmath, loc voice_typing, switch_backward
Layout doesn't define some important keys, missing: loc esc, loc tab
Layout redefines the bottom row but some important keys are missing, missing: cursor_left, cursor_right, loc compose, loc end, loc home, loc page_down, loc page_up, loc switch_clipboard, loc switch_greekmath, loc voice_typing, switch_backward
2 warnings
# latn_colemak
Some keys contain whitespaces, unexpected: ́
@ -77,18 +82,22 @@ Some keys contain whitespaces, unexpected: ́
# latn_dvorak
0 warnings
# latn_neo2
0 warnings
Layout redefines the bottom row but some important keys are missing, missing: loc switch_clipboard
1 warnings
# latn_qwerty_br
0 warnings
# latn_qwerty_cz
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
1 warnings
0 warnings
# latn_qwerty_da
0 warnings
# latn_qwerty_es
0 warnings
# latn_qwerty_gb
0 warnings
# latn_qwerty_hu
0 warnings
# latn_qwerty_jp
0 warnings
# latn_qwerty_lv
0 warnings
# latn_qwerty_no
@ -101,15 +110,15 @@ Layout doesn't define some important keys, missing: f11_placeholder, f12_placeho
Duplicate keys: !, ', ,, -, ., ?
1 warnings
# latn_qwerty_sk
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
1 warnings
0 warnings
# latn_qwerty_sr
0 warnings
# latn_qwerty_tly
Duplicate keys: a, c, j, q
Layout doesn't define some important keys, missing: esc, f11_placeholder, f12_placeholder, tab
Layout doesn't define some important keys, missing: loc esc, loc tab
2 warnings
# latn_qwerty_tr
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
1 warnings
0 warnings
# latn_qwerty_us
0 warnings
# latn_qwerty_vi
@ -117,12 +126,10 @@ Layout doesn't define some important keys, missing: f11_placeholder, f12_placeho
# latn_qwertz
0 warnings
# latn_qwertz_cz
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
1 warnings
0 warnings
# latn_qwertz_cz_multifunctional
Layout includes some ASCII punctuation but not all, missing: `
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
2 warnings
1 warnings
# latn_qwertz_de
0 warnings
# latn_qwertz_fr_ch
@ -131,11 +138,11 @@ Layout doesn't define some important keys, missing: f11_placeholder, f12_placeho
0 warnings
# latn_qwertz_sk
Layout includes some ASCII punctuation but not all, missing: `
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
2 warnings
1 warnings
# shaw_imperial_en
0 warnings
# urdu_phonetic_ur
Duplicate keys:
Layout includes some ASCII punctuation but not all, missing: <, >, ?, `, |, ~
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
Some keys contain whitespaces, unexpected:
4 warnings
3 warnings

View File

@ -6,7 +6,14 @@ warning_count = 0
KNOWN_NOT_LAYOUT = set([
"number_row", "numpad", "pin",
"bottom_row", "settings", "method",
"greekmath", "numeric", "emoji_bottom_row" ])
"greekmath", "numeric", "emoji_bottom_row",
"clipboard_bottom_row" ])
KEY_ATTRIBUTES = set([
"key0",
"key1", "key2", "key3", "key4", "key5", "key6", "key7", "key8",
"nw", "ne", "sw", "se", "w", "e", "n", "s"
])
def warn(msg):
global warning_count
@ -38,7 +45,7 @@ def unexpected_keys(keys, symbols, msg):
def parse_row_from_et(row, keys, dup):
for key in row:
for attr in key.keys():
if attr.startswith("key"):
if attr in KEY_ATTRIBUTES:
k = key.get(attr).removeprefix("\\")
if k in keys: dup.add(k)
keys.add(k)
@ -68,8 +75,7 @@ def check_layout(layout):
missing_some_of(keys, "~!@#$%^&*(){}`[]=\\-_;:/.,?<>'\"+|", "ASCII punctuation")
missing_some_of(keys, "0123456789", "digits")
missing_required(keys,
["esc", "tab", "backspace", "delete",
"f11_placeholder", "f12_placeholder"],
["loc esc", "loc tab", "backspace", "delete"],
"Layout doesn't define some important keys")
unexpected_keys(keys,
["copy", "paste", "cut", "selectAll", "shareText",
@ -82,6 +88,7 @@ def check_layout(layout):
unexpected_keys(keys, [""], "Layout contains empty strings")
unexpected_keys(keys, ["loc"], "Special keyword cannot be a symbol")
unexpected_keys(keys, filter(lambda k: k.strip()!=k, keys), "Some keys contain whitespaces")
unexpected_keys(keys, ["f11_placeholder", "f12_placeholder"], "These keys are now added automatically")
_, bottom_row_keys, _ = parse_row("res/xml/bottom_row.xml")

155
doc/Custom-layouts.md Normal file
View File

@ -0,0 +1,155 @@
# Custom layouts
You select a key layout for Unexpected Keyboard by calling up the Settings page (swipe the gear icon) and, at the top of the page, either tapping an existing layout or tapping _Add an alternate layout_. This displays a menu of available layouts. You can define your own layout by choosing _Custom layout_ at the bottom of this menu. Unexpected Keyboard now displays code in the XML format. You make changes by replacing this with different code and tapping OK.
We recommend you keep your work in a file outside Unexpected Keyboard (named something like `MyChanges.xml`). If you installed a new version of Unexpected from a different website (with a different signature), then the work you did solely by editing the XML inside Unexpected would be lost.
Put initial contents into your file in one of these ways:
* Copypaste the code Unexpected displays for _Custom layout_.
* Make a copy of one of the built-in layouts found in [`/srcs/layouts`](https://github.com/Julow/Unexpected-Keyboard/tree/master/srcs/layouts).
* Use the [web-based editor](https://unexpected-keyboard-layout-editor.lixquid.com/). Interact with this web page to define keys and swipes and move keys to desired positions, and it will write the XML code for you. You can make the web page put the XML in a text file or copy it to the clipboard.
When you have prepared suitable XML code in one of these ways, copy it to the clipboard and paste it into Unexpected Keyboard.
## XML language overview
A layout XML file comprises tags that start with `<` and end with `>`.
* Every layout file starts with this declaration:
`<?xml version="1.0" encoding="utf-8"?>`
* Certain tags come in pairs—an opening tag and a closing tag—and apply to everything between them.
* The `<keyboard>`...`</keyboard>` pair says that the material between them is the definition of your keyboard. There can be only one of these.
* The `<row>`...`</row>` pair encloses the definition of a single row.
* An optional `<modmap>`...`</modmap>` pair contains instructions if you want to change the behavior of a modifier key such as Shift.
* Stand-alone tags include `<key`...`/>`, which defines a single key.
A tag can have properties, defined using an equals sign and a pair of ASCII double quotes. For example, `<key key0="a" />` defines the "a" key. The `key0` property of the `key` tag says which key you are defining, and the tag's location inside `<row>`...`</row>` specifies where it will go in the row.
### Example
Here is a complete keyboard file with a single row containing an "a" key on the left and a "b" key on the right:
<?xml version="1.0" encoding="utf-8"?>
<keyboard name="Simple example" script="latin">
<row>
<key key0="a" />
<key key0="b" />
</row>
</keyboard>
## Keyboard metadata
The `<keyboard>`...`</keyboard>` pair follows the declaration tag and encloses the whole keyboard. The following properties may be used (The first two appear in the example above):
* `name`: The name of the keyboard. The name you specify will appear in the Settings menu. If not present, the layout will just appear as “Custom layout”.
* `script`: The (main) writing system that the keyboard supports. The possible values are `arabic`, `armenian`, `bengali`, `cyrillic`, `devanagari`, `gujarati`, `hangul`, `hebrew`, `latin`, `persian`, `shavian`, and `urdu`. It defaults to `latin`.
* `numpad_script`: The script to use for the numpad. This is useful for scripts where a different, non-ASCII set of numerals is used, like Devanagari and Arabic. It defaults to the same as `script`.
* `bottom_row`: Whether or not to show the built-in bottom row. It accepts `true` or `false`, and defaults to `true`. If your custom layout defines the bottom row, then specify `bottom_row="false"` to disable the built-in bottom row.
+ We recommend your layout use the built-in bottom row, because it is still evolving and your layout will incorporate innovations in future versions. However, to define your own, the current definition of the bottom row is in [bottom_row.xml](https://github.com/Julow/Unexpected-Keyboard/res/xml/bottom_row.xml). You can copypaste this XML into your custom layout as a starting point.
+ Likewise, the current definition of the top (number) row is in [number_row.xml](https://github.com/Julow/Unexpected-Keyboard/res/xml/number_row.xml).
* `locale_extra_keys`: Whether Unexpected should add language-dependent extra keys from [method.xml](../res/xml/method.xml) to this layout. It accepts `true` or `false`, and defaults to `true`. To disable these automatic additions, specify `locale_extra_keys="false"`.
## Row
The `<row>`...`</row>` pair encloses one row on the keyboard. It has only one optional property:
* `height`: The height of the row: a positive floating-point value.
A row's default height is 1.0 (one quarter of the keyboard height specified on the Settings menu). The `height` property makes the row taller or shorter than this. For example, if you define a 5-row keyboard but one row has `height="0.7"`, then the keyboard's total height is 4.7 units. If the total is different from 4.0, the keyboard will be taller or shorter than that specified in Settings.
## Key
The `<key />` tag defines a key on the keyboard. Its position in the sequence of keys inside `<row>`...`</row>` indicates its position in the row from left to right. What the key does is defined by optional properties.
### Taps
What the key does when tapped is defined by the optional `key0` property. For example, `<key key0="a" />` defines the "a" key. Unexpected Keyboard provides a legend in the middle of the key.
When the Shift modifier is tapped, the "a" key becomes the "A" key and the legend temporarily changes. The Fn modifier makes a different change. You can override this behavior with a modmap (see below).
### Swipes
The following optional properties define the effects of swipes:
* `n`, `ne`, `e`, `se`, `s`, `sw`, `w`, `nw`: What the key should do when it is swiped in the direction of that compass point. ("North" means upward and "East" is to the right.)
<TABLE ALIGN=CENTER>
<TR>
<TD STYLE="width: 6em;">nw</TD><TD>n</TD><TD>ne</TD>
</TR>
<TR ALIGN=CENTER>
<TD>w</TD><TD>&nbsp;</TD><TD>e</TD>
</TR>
<TR>
<TD>sw</TD><TD>s</TD><TD>se</TD>
</TR>
</TABLE>
* `key1` through `key8` is an older way to achieve the same effects. The directions are ordered as follows:
<TABLE ALIGN=CENTER>
<TR>
<TD>key1</TD><TD>key7</TD><TD>key2</TD>
</TR>
<TR>
<TD>key5</TD><TD>&nbsp;</TD><TD>key6</TD>
</TR>
<TR>
<TD>key3</TD><TD>key8</TD><TD>key4</TD>
</TR>
</TABLE>
You can define a swipe only once with either compass-point or numeric notation. Unexpected Keyboard automatically puts a small legend in that direction from the center of the key.
* `slider`: If `slider="true"`, and the key also has `w` and `e` properties, then the key tracks horizontal finger motion precisely and sends the `w` and `e` keystrokes repeatedly. In built-in layouts, this makes the space bar send left and right characters as the user slides on the space bar.
* `anticircle`: The key value to send when doing an anti-clockwise gesture on the key.
### Layout
A key may have the following properties to control the row's layout:
* `width`: The width of the key, a positive floating-point value. It defaults to 1.0
* `shift`: How much empty space to add to the left of this key, a non-negative floating-point value. It defaults to 0.0
Normally, a key's width is 1.0 unit. Unexpected Keyboard occupies the full width of the screen, and the row defining the highest number of units (in widths plus shifts) is as wide as the screen. A row whose width is a smaller number of units has empty space on the right.
### Extra legend
* `indication`: An optional extra legend to show under the main label. For example, `<key key0="2" indication="ABC" />` displays ABC at the bottom of the 2 key, as on a pinpad or some telephones. If the key also defines a downward swipe with `s` or `key8`, the legends overlap.
### Possible key values
Built-in strings that assign a special function to a key are described in [this page](Possible-key-values.md). For example, `se="copy"` means a southeasterly swipe produces the Copy key. If a key value does not match any of the built-in strings, it outputs that text _verbatim_. For example, `key0="a"` simply outputs the letter a.
In a layout, a key value can also start with the `loc` prefix. These are place-holders; the tap or swipe does nothing unless enabled through the "Add keys to keyboard" option in the Settings menu, or implicitly enabled by the language the device is set to use. For example, `ne="loc accent_aigu"` says that a northeast swipe produces the acute accent combinatorial key—if enabled.
## Modmap
The `<modmap>`...`</modmap>` pair encloses custom mappings for modifier keys. The modmap is placed inside the `<keyboard>`...`</keyboard>` pair, but outside any row. A layout can have at most one modmap. It can contain any number of mappings. Each mapping has an `a` property and a `b` property and maps the `a` key to the `b` key. Valid values are listed in [Possible key values](Possible-key-values.md).
The following mappings are supported:
```xml
<shift a="before" b="after" />
```
This means that when the Shift modifier is on, the key `before` is changed into `after`.
```xml
<fn a="before" b="after" />
```
This means that when the Fn modifier is on, the key `before` is changed into `after`.
```xml
<ctrl a="before" b="after" />
```
This means that when the Ctrl modifier is on, the key `before` is changed into `after`. The `<ctrl />` mapping is special in that the Ctrl modifier is applied to `after` after the mapping.
The clockwise circle and the round-trip gestures are affected by both `<shift />` and `<fn />` mappings. The Shift mappings are used first and if that did not modify the key, the Fn mappings are used instead.
### Examples
① Turkish keyboards use the Latin alphabet, but when "i" is shifted, it should produce "İ". This is achieved with the following mapping:
```xml
<shift a="i" b="İ" />
```
② Cyrillic layouts have no V key. A layout can define Ctrl-V with the following mapping:
```xml
<ctrl a="в" b="v" />
```
This maps Ctrl+в to Ctrl+V—not to v.
## Portrait vs. landscape
Unexpected Keyboard remembers *separately* which layout has last been used in portrait and landscape orientation. So you may have one custom layout for portrait orientation, but another custom layout for landscape orientation, and Unexpected Keyboard will switch between them without your intervention.
## Contributing your layout
The Unexpected Keyboard project enthusiastically accepts user contributions, including custom layouts. (See the guidance for layouts at [CONTRIBUTING.md](https://github.com/Julow/Unexpected-Keyboard/blob/master/CONTRIBUTING.md#Adding-a-layout)).
* Submit a layout that has innovations of possible interest to other users at [Unexpected-Keyboard-layouts](https://github.com/Julow/Unexpected-Keyboard-layouts).
* Propose that your layout be included in the set of built-in layouts by making a Pull Request for an addition to [srcs/layouts](https://github.com/Julow/Unexpected-Keyboard/tree/master/srcs/layouts). Please show that such a layout is standard in your locale or has a substantial number of users.

190
doc/Possible-key-values.md Normal file
View File

@ -0,0 +1,190 @@
# Key values
This is an exhaustive list of special values accepted for the `key0` through `key8` or `nw` through `se` attributes on a key.
Any string that does not exactly match these will be printed verbatim.
A key can output multiple characters, but cannot combine multiple built-in key values.
## Escape codes
Value | Escape code for
:---- | :------
`\?` | `?`
`\#` | `#`
`\@` | `@`
`\n` | Literal newline character. This is different from `enter` and `action` in certain apps.
`\t` | Literal tab character. This is different from `tab` in certain apps.
`\\` | `\`
XML escape codes also work, including:
Value | Escape code for
:------- | :------
`&amp;` | `&`
`&lt;` | `<`
`&gt;` | `>`
`&quot;` | `"`
## Modifiers
System modifiers are sent to the app, which is free to do whatever they want in response.
The other modifiers only exist within the keyboard.
Value | Meaning
:---------- | :------
`shift` | System modifier.
`ctrl` | System modifier.
`alt` | System modifier.
`meta` | System modifier. Equivalent to the Windows key.
`fn` | Activates Fn mode, which assigns letters and symbols to special characters. e.g. `fn` `!` = `¡`
`compose` | Compose key. Enables composing characters using Linux-like shortcuts; e.g. `Compose` `A` `single quote` types `Á` (A with acute accent).
`capslock` | Actives and locks Shift
## Special keys
These keys are sent to apps, which are free to ignore them. The keyboard does not perform editing in response to these keys.
`esc`, `enter`,
`up`, `right`,
`down`, `left`,
`page_up`, `page_down`,
`home`, `end`,
`backspace`, `delete`,
`insert`, `scroll_lock`,
`f1`-`f12`,
`tab`, `copy`,
`paste`, `cut`,
`selectAll`, `pasteAsPlainText`,
`undo`, `redo`
## Whitespace
Value | Meaning
:------ | :------
`space` | Space bar.
`nbsp` | Non-breaking space.
`nnbsp` | Narrow non-breaking space.
`zwj` | Zero-width joiner.
`zwnj` | Zero-width non-joiner.
## Keyboard editing actions
These keys perform editing on the text without sending keys that the app can interpret differently or ignore.
Value | Meaning
:----------------- | :------
`cursor_left` | Moves the cursor position to the left directly, without sending a `left` key event.
`cursor_right` | Moves the cursor position to the right directly, without sending a `right` key event.
## Other modifiers and diacritics
Value | Meaning
:------------------- | :------
`accent_aigu` | Acute accent. `á`
`accent_caron` | Háček. `č`
`accent_cedille` | Cedilla. `ç`
`accent_circonflexe` | Circumflex. `â`
`accent_grave` | Grave accent. `à`
`accent_macron` | Macron. `ā`
`accent_ring` | Ring accent. `å`
`accent_tilde` | Tilde. `ã`
`accent_trema` | Dieresis/umlaut. `ä`
`accent_ogonek` | Ogonek. `ą`
`accent_dot_above` | Dot accent. `ż` If applied to the lowercase `i`, removes the dot instead for Turkish. `ı`
`accent_double_aigu` | Double acute accent. `ő`
`accent_slash` | Slash through. `ø`
`accent_arrow_right` | Right arrow above, used to denote a vector. `a⃗`
`accent_breve` | Breve. `ă`
`accent_bar` | Bar/strikethrough. `ɨ`
`accent_dot_below` | Dot below. `ạ`
`accent_horn` | Horn accent. `ơ`
`accent_hook_above` | Hook accent. `ả`
`superscript` | Superscript. `ᵃ`
`subscript` | Subscript. `ₐ`
`ordinal` | Turns `a` and `o` into `ª` and `º`.
`arrows` | Turns `1`-`4` and `6`-`9` into arrows.
`box` | Turns `1`-`9`, `0`, and `.` into single-line, thin box-drawing characters.
## Bidirectional
Value | Meaning
:------ | :------
`lrm` | Left-to-right mark.
`rlm` | Right-to-left mark.
`b(`, `b)`, `b[`, `b]`, `b{`, `b}`, `blt`, `bgt` | Sends the bracket characters, but with mirrored key legends for right-to-left languages. (`blt` and `bgt` print `<` and `>` respectively.)
## Hebrew
Keys ending in `_placeholder` are normally hidden unless the Fn key is pressed.
`qamats`, `patah`,
`sheva`, `dagesh`,
`hiriq`, `segol`,
`tsere`, `holam`,
`qubuts`, `hataf_patah`,
`hataf_qamats`, `hataf_segol`,
`shindot`, `shindot_placeholder`,
`sindot`, `sindot_placeholder`,
`geresh`, `gershayim`,
`maqaf`, `rafe`,
`ole`, `ole_placeholder`,
`meteg`, `meteg_placeholder`
## Keyboard behavior keys
Value | Meaning
:--------------------- | :------
`config` | Gear icon; opens Unexpected Keyboard settings.
`switch_text` | Switch to the text layer (main layer).
`switch_numeric` | Switch to the numeric layer.
`switch_emoji` | Switch to the emoji layer.
`switch_back_emoji` | Switch to the text layer from the emoji layer.
`switch_forward` | Change the keyboard layout, as long as Unexpected Keyboard has multiple keyboard layouts enabled in the settings.
`switch_backward` | Change the keyboard layout to the previous one in the list.
`switch_greekmath` | Switch to the Greek & Math Symbols layer.
`switch_clipboard` | Switch to the clipboard pane.
`change_method` | Open the input method picker dialog.
`change_method_prev` | Switch to the previously used input method.
`action` | Performs a special context-sensitive operation related to the Enter key. For example, in the Twitter (X) app, `enter` adds a new line, while `action` posts.
`voice_typing` | Begin voice typing.
`voice_typing_chooser` | Shows a menu where you can choose which voice typing provider to use, then begins voice typing when you make a selection.
`shareText` | Emit a share Intent for the selected text. **Oddity:** This is in CamelCase.
## Unused
These keys are known to do nothing.
`replaceText`, `textAssist`,
`autofill`, `removed`
## Placeholders
These keys are normally hidden unless the Fn modifier is activated.
`f11_placeholder` | `f12_placeholder`
## Complex keys
More complex keys are of this form:
```
:<kind> <attributes>:<payload>
```
Where `<kind>` is one of the kinds documented below and `<attributes>` is a
space separated list of attributes. `<payload>` depends on the `<kind>`.
Attributes are:
- `symbol='Sym'` specifies the symbol to be shown on the keyboard.
- `flags='<flags>'` changes the behavior of the key.
`<flags>` is a coma separated list of:
+ `dim`: Make the symbol dimmer.
+ `small`: Make the symbol smaller.
### Kind `str`
Defines a key that outputs an arbitrary string. `<payload>` is a string wrapped
in single-quotes (`'`), escaping of other single quotes is allowed with `\'`.
For example:
- `:str:'Arbitrary string with a \' inside'`
- `:str symbol='Symbol':'Output string'`
### Kind `char`
Defines a key that outputs a single character. `<payload>` is the character to
output, unquoted.
This kind of key can be used to define a character key with a different symbol
on it. `char` keys can be modified by `ctrl` and other modifiers, unlike `str`
keys.
For example:
- `:char symbol='q':љ`, which is used to implement `ctrl` shortcuts in cyrillic
layouts.

View File

@ -0,0 +1,6 @@
Hlavní funkcí je možnost psát více znaků posunutím kláves směrem k rohům.
Tato aplikace byla původně navržena pro programátory používající Termux.
Nyní je ideální pro každodenní použití.
Tato aplikace neobsahuje žádné reklamy, nevyužívá připojení k síti a je Open Source.

View File

@ -0,0 +1,11 @@
MessagEase and Thumb-Key inspired gestures with the anti-clockwise circle being
completely configurable.
Updated emojis.
Improved Hangul (Korean) support.
Added Danish support.
Improved spacebar slider.
Updated translations.
Various improvements and fixes to the app and layouts.
Many thanks to the contributors: @alotbsol555 @bkmgit @Cheesebaron @CloneWith @eandersons @JapanYoshi @Julow @la-ninpre @m15a @marciozomb13 @polyctena @solokot @Spike-from-NH @tmqCypher @Validbit

View File

@ -0,0 +1,8 @@
Clipboard pane
New Monet theme
Improvements to custom layouts
Options to disable key repeat and the circle gesture
Options to disable the Tab and Esc keys
Many thanks to the contributors: @alotbsol555 @ChasmSolacer @eandersons @polyctena @Sestowner @solokot @Spike-from-NH @TadaCZE @V6lhost @Validbit

View File

@ -0,0 +1,6 @@
Fix crash on Android 6.
Fix scaling issues for layouts with few columns.
Added Serbian layouts.
Layout and compose key tweaks. Improvements to custom layouts. Added Menu key.
Many thanks to the contributors: @adrian4096 @asivery @bokidori @dingodoppelt @RZHSSNZDH

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

View File

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -0,0 +1,7 @@
このキーボードは、キーの角をスワイプすることで様々なキーを入力できます。
このアプリは元々はTermuxでのプログラミング用に設計されました。
しかし、今では普段の入力にも適しています。
PCキーボードでの半角入力を再現しています。日本語入力、変換は出来ません。
このアプリは広告を含まず、インターネットに接続せず、そしてオープンソースです。

View File

@ -0,0 +1 @@
軽量でプライバシーに配慮したAndroid用仮想キーボード

View File

@ -0,0 +1,6 @@
주요 기능은 모서리 방향으로 키를 스와이프하여 더 많은 문자를 입력할 수 있다는 것입니다.
이 앱은 처음에는 Termux를 사용하는 프로그래머들을 위한 것으로 개발되었습니다.
지금은 일상적인 용도로도 완벽합니다.
이 응용 프로그램에는 광고가 없으며 네트워크 요청을 하지 않고 오픈 소스입니다.

View File

@ -0,0 +1,6 @@
A principal característica é que você pode digitar mais caracteres deslizando as teclas para os cantos.
O app foi criado originalmente para desenvolvedores que usam Termux.
Agora aperfeiçoado para o uso diário.
Este aplicativo não contém anúncios, não faz nenhuma solicitação de rede e é Open Source.

View File

@ -0,0 +1,6 @@
Главная особенность клавиатуры — это возможность легко напечатать любой ASCII-символ жестами в углы клавиш.
Приложение изначально было разработано для использования с Termux.
На данный момент оно также удобно в повседневном использовании.
Приложение не содержит рекламы, не осуществляет никаких запросов в сеть и имеет открытый исходный код.

View File

@ -0,0 +1 @@
Unexpected Keyboard

View File

@ -0,0 +1,6 @@
此应用的主要功能是,通过将按键沿四角滑动,您可以输入更多字符。
此应用最初是为使用 Termux 的程序员而设计的。
现在对于日常使用来说也很完美。
此应用没有广告,不会发送任何网络请求,而且是开源的。

View File

@ -0,0 +1 @@
适用于 Android 的轻量级、注重隐私的虚拟键盘。

View File

@ -0,0 +1 @@
Unexpected Keyboard

38
gen_emoji.py Normal file
View File

@ -0,0 +1,38 @@
import urllib.request
import os.path
EMOJIS_PATH = 'res/raw/emojis.txt'
EMOJI_TEST_PATH = 'emoji-test.txt'
EMOJI_TEST_URL = 'https://unicode.org/Public/emoji/latest/emoji-test.txt'
def rawEmojiFromCodes(codes):
return ''.join([chr(int(c, 16)) for c in codes])
def getEmojiTestContents():
if os.path.exists(EMOJI_TEST_PATH):
print(f'Using existing {EMOJI_TEST_PATH}')
else:
print(f'Downloading {EMOJI_TEST_URL}')
urllib.request.urlretrieve(EMOJI_TEST_URL, EMOJI_TEST_PATH)
return open(EMOJI_TEST_PATH, mode='r', encoding='UTF-8').read()
emoji_list = []
group_indices = []
for line in getEmojiTestContents().splitlines():
if line.startswith('# group:'):
if len(group_indices) == 0 or len(emoji_list) > group_indices[-1]:
group_indices.append(len(emoji_list))
elif not line.startswith('#') and 'fully-qualified' in line:
codes = line.split(';')[0].split()
emoji_list.append(rawEmojiFromCodes(codes))
with open(EMOJIS_PATH, 'w', encoding='UTF-8') as emojis:
for e in emoji_list:
emojis.write(f'{e}\n')
emojis.write('\n')
emojis.write(' '.join([str(g) for g in group_indices]))
emojis.write('\n')
print(f'Parsed {len(emoji_list)} emojis in {len(group_indices)}')

Some files were not shown because too many files have changed in this diff Show More