Compare commits

..

11 Commits

Author SHA1 Message Date
Jules Aguillon
f0ebe45439 Release 1.31.0 (47)
Some checks failed
Make Apk CI / Build-Apk (push) Has been cancelled
Check translations / check-translations (push) Has been cancelled
Check layouts / check_layout.output (push) Has been cancelled
Check layouts / Generated files (push) Has been cancelled
2025-03-16 15:45:05 +01:00
Jules Aguillon
0ef36d52e1 Fix crash on API < 26 in settings 2025-03-16 15:44:02 +01:00
0skar2
08860eed17 Better material themes (#904)
Some checks are pending
Check layouts / check_layout.output (push) Waiting to run
Check layouts / Generated files (push) Waiting to run
Check translations / check-translations (push) Waiting to run
Make Apk CI / Build-Apk (push) Waiting to run
2025-03-16 14:59:41 +01:00
Jules Aguillon
b8bd3f7b0f Pull changes from Weblate 2025-03-16 14:47:59 +01:00
Jules Aguillon
60b01927ab Selection mode (#913)
Some checks are pending
Check layouts / Generated files (push) Waiting to run
Check translations / check-translations (push) Waiting to run
* 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.
2025-03-15 16:13:16 +01:00
Jules Aguillon
9cfeb0f0c2 Add a delay after a Keyevent key in a macro (#918)
Some checks failed
Make Apk CI / Build-Apk (push) Has been cancelled
Check translations / check-translations (push) Has been cancelled
Check layouts / check_layout.output (push) Has been cancelled
Check layouts / Generated files (push) Has been cancelled
* Construct a single handler

* Add a delay after a Keyevent key in a macro

Add a delay before sending the next key to avoid race conditions causing
keys to be handled in the wrong order. Notably, KeyEvent keys handling
is scheduled differently than the other edit functions.
2025-03-10 23:41:51 +01:00
Spike
5e77fa84cf doc: Massage section on "Escape codes" (#912)
Some checks failed
Make Apk CI / Build-Apk (push) Has been cancelled
Check translations / check-translations (push) Has been cancelled
Check layouts / check_layout.output (push) Has been cancelled
Check layouts / Generated files (push) Has been cancelled
* Add introductory text to the tables

And mention characters that don't have escapes

* Turn tables around

Tables should be structured by what the user wants, not by what the code does.

* Address Julow review #1

- Merge tables, no matter which rule requires escaping; "in the usual way for XML" applies to both
- 3 escapes not mandatory removed from table to new ¶ below
- Found one more symbol → legend

* doc: Clarify escaping of comma and colon per #915
2025-03-08 12:11:54 +01:00
Jules Aguillon
06fbc83c9c sync_translations.py: Handle '\n' in store descriptions
These are added by Weblate.
2025-03-08 12:08:57 +01:00
Jules Aguillon
a123810247 Change indentation of strings.xml files to match Weblate
This runs sync_translations.py, which also remove uneeded comments.
2025-03-08 12:05:35 +01:00
Jules Aguillon
906755b787 prefs: Add 'delete_word' and 'forward_delete_word' to extra keys
Some checks failed
Make Apk CI / Build-Apk (push) Has been cancelled
Check translations / check-translations (push) Has been cancelled
Check layouts / check_layout.output (push) Has been cancelled
Check layouts / Generated files (push) Has been cancelled
The gesture combination is mentioned. Preferred position are added.
2025-03-01 16:52:46 +01:00
Jules Aguillon
80c52460c7 Add 'delete_word' and 'forward_delete_word' keys
These keys are the equivalent of ctrl+backspace and ctrl+delete,
respectively.

They can be reached with Gesture+backspace and Gesture+delete
respectively.
2025-03-01 16:52:46 +01:00
31 changed files with 2571 additions and 2499 deletions

View File

@@ -14,8 +14,8 @@ android {
applicationId "juloo.keyboard2" applicationId "juloo.keyboard2"
minSdk 21 minSdk 21
targetSdkVersion 35 targetSdkVersion 35
versionCode 46 versionCode 47
versionName "1.30.3" versionName "1.31.0"
} }
sourceSets { sourceSets {

View File

@@ -25,31 +25,30 @@ Key values can be any of the following:
+ `⏯:keyevent:85` A play/pause key (which has no effect in most apps). + `⏯:keyevent:85` A play/pause key (which has no effect in most apps).
+ `my@:'my.email@domain.com'` A key that sends an arbitrary string + `my@:'my.email@domain.com'` A key that sends an arbitrary string
- A macro, `symbol:key_def1,key_def2,...`. - A macro, `legend:key_def1,key_def2,...`.
This results in a key that behaves as if the sequence of `key_def` had been pressed in order. This results in a key with legend `legend` that behaves as if the sequence of `key_def` had been pressed in order.
Examples: Examples:
+ `CA:ctrl,a,ctrl,c` A key with legend CA that sends the sequence `ctrl+a`, `ctrl+c`. + `CA:ctrl,a,ctrl,c` A key with legend CA that sends the sequence `ctrl+a`, `ctrl+c`.
+ `Cd:ctrl,backspace` A key with legend Cd that sends the shortcut `ctrl+backspace`. + `Cd:ctrl,backspace` A key with legend Cd that sends the shortcut `ctrl+backspace`.
## Escape codes ### Escape codes
Value | Escape code for
When defining a key value, several characters have special effects. If you want a character not to have its usual effect but to be taken literally, you should "escape" it in the usual way for XML:
To get this character... | ...you can type
:---- | :------ :---- | :------
`\?` | `?` A literal newline character, which is different from `enter` and `action` in certain apps. | `\n`
`\#` | `#` A literal tab character, which is different from `tab` in certain apps. | `\t`
`\@` | `@` `\` | `\\`
`\n` | Literal newline character. This is different from `enter` and `action` in certain apps. `&` | `&amp;`
`\t` | Literal tab character. This is different from `tab` in certain apps. `<` | `&lt;`
`\\` | `\` `>` | `&gt;`
`"` | `&quot;`
XML escape codes also work, including: The characters `?`, `#`, and `@` do not need to be escaped when writing custom layouts. Internally, they can be escaped by prepending backslash (by typing `\?`, `\#`, and `\@`).
Value | Escape code for The characters `,` and `:` can be escaped in a key value, using single quotes. For example, this macro defines a key with legend `http` that sends a string containing `:`: `<key c="http:home,'https://'" />` For simplicity, `,` and `:` cannot be escaped in the key legend.
:------- | :------
`&amp;` | `&`
`&lt;` | `<`
`&gt;` | `>`
`&quot;` | `"`
## Modifiers ## Modifiers
System modifiers are sent to the app, which can take app-specific action. System modifiers are sent to the app, which can take app-specific action.

View File

@@ -0,0 +1,6 @@
Delete a word with a circle gesture on the delete key.
Compose key can be unselected.
Improved space bar slider and added selection mode.
Lock shift with a circle gesture.
Improvements to layouts.
Various bug fixes and improvements to themes.

View File

@@ -3,12 +3,7 @@
<string name="app_name_release">Klávesnice Unexpected</string> <string name="app_name_release">Klávesnice Unexpected</string>
<string name="app_name_debug">Klávesnice Unexpected (pro ladění)</string> <string name="app_name_debug">Klávesnice Unexpected (pro ladění)</string>
<string name="short_description">Nenáročná virtuální klávesnice pro vývojáře.</string> <string name="short_description">Nenáročná virtuální klávesnice pro vývojáře.</string>
<string name="store_description">"Hlavní funkcí je možnost psát více znaků posunutím kláves směrem k rohům. <string name="store_description">Hlavní funkcí je možnost psát více znaků posunutím kláves směrem k rohům.\n\nTato aplikace byla původně navržena pro programátory používající Termux.\nNyní je ideální pro každodenní použití.\n\nTato aplikace neobsahuje žádné reklamy, nevyužívá připojení k síti a je Open Source.</string>
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."</string>
<string name="settings_activity_label">Nastavení Klávesnice Unexpected</string> <string name="settings_activity_label">Nastavení Klávesnice Unexpected</string>
<string name="pref_portrait">V režimu na výšku</string> <string name="pref_portrait">V režimu na výšku</string>
<string name="pref_landscape">V režimu na šířku</string> <string name="pref_landscape">V režimu na šířku</string>

View File

@@ -3,12 +3,7 @@
<string name="app_name_release">Unexpected Keyboard</string> <string name="app_name_release">Unexpected Keyboard</string>
<string name="app_name_debug">Unexpected Keyboard (Debug)</string> <string name="app_name_debug">Unexpected Keyboard (Debug)</string>
<string name="short_description">Eine schlanke, datenschutzfreundliche Bildschirmtastatur für Android.</string> <string name="short_description">Eine schlanke, datenschutzfreundliche Bildschirmtastatur für Android.</string>
<string name="store_description">"Diese Tastatur zeichnet sich dadurch aus, dass man zusätzliche Zeichen durch Wischgesten in Richtung der Tastenecken eingeben kann. <string name="store_description">Diese Tastatur zeichnet sich dadurch aus, dass man zusätzliche Zeichen durch Wischgesten in Richtung der Tastenecken eingeben kann.\n\nDie Anwendung wurde ursprünglich für das Programmieren in Termux entwickelt.\nMittlerweile ist sie auch für den täglichen Gebrauch perfekt geeignet.\n\nDiese App enthält keine Werbung, benötigt keinen Netzwerkzugriff und ist quelloffen.</string>
Die Anwendung wurde ursprünglich für das Programmieren in Termux entwickelt.
Mittlerweile ist sie auch für den täglichen Gebrauch perfekt geeignet.
Diese App enthält keine Werbung, benötigt keinen Netzwerkzugriff und ist quelloffen."</string>
<string name="settings_activity_label">Unexpected Keyboard - Einstellungen</string> <string name="settings_activity_label">Unexpected Keyboard - Einstellungen</string>
<string name="pref_portrait">Im Hochformatmodus</string> <string name="pref_portrait">Im Hochformatmodus</string>
<string name="pref_landscape">Im Querformatmodus</string> <string name="pref_landscape">Im Querformatmodus</string>

View File

@@ -3,12 +3,7 @@
<string name="app_name_release">Unexpected Keyboard</string> <string name="app_name_release">Unexpected Keyboard</string>
<string name="app_name_debug">Unexpected Keyboard (debug)</string> <string name="app_name_debug">Unexpected Keyboard (debug)</string>
<string name="short_description">Un teclado virtual ligero para Android consciente de su privacidad.</string> <string name="short_description">Un teclado virtual ligero para Android consciente de su privacidad.</string>
<string name="store_description">"La característica principal es que hay acceso a más caractéres deslizando hacia las esquinas de las teclas. <string name="store_description">La característica principal es que hay acceso a más caractéres deslizando hacia las esquinas de las teclas.\n\nEsta aplicación fue originalmente diseñada para programadores que usaran Termux.\nAhora es perfecta para uso cotidiano.\n\nLa misma no contiene ningún anuncio/publicidad, no realiza peticiones de red y es de Fuente Abierta.</string>
Esta aplicación fue originalmente diseñada para programadores que usaran Termux.
Ahora es perfecta para uso cotidiano.
La misma no contiene ningún anuncio/publicidad, no realiza peticiones de red y es de Fuente Abierta."</string>
<string name="settings_activity_label">Ajustes de Unexpected Keyboard</string> <string name="settings_activity_label">Ajustes de Unexpected Keyboard</string>
<string name="pref_portrait">En modo vertical</string> <string name="pref_portrait">En modo vertical</string>
<string name="pref_landscape">En modo horizontal</string> <string name="pref_landscape">En modo horizontal</string>

View File

@@ -3,12 +3,7 @@
<string name="app_name_release">صفحه کلید غیرمنتظره</string> <string name="app_name_release">صفحه کلید غیرمنتظره</string>
<string name="app_name_debug">صفحه کلید غیرمنتظره</string> <string name="app_name_debug">صفحه کلید غیرمنتظره</string>
<!-- <string name="short_description">Lightweight and privacy-conscious virtual keyboard for Android.</string> --> <!-- <string name="short_description">Lightweight and privacy-conscious virtual keyboard for Android.</string> -->
<!-- <string name="store_description">"The main feature is that you can type more characters by swiping the keys towards the corners. <!-- <string name="store_description">The main feature is that you can type more characters by swiping the keys towards the corners.\n\nThis application was originally designed for programmers using Termux.\nNow perfect for everyday use.\n\nThis application contains no ads, doesn\'t make any network requests and is Open Source.</string> -->
This application was originally designed for programmers using Termux.
Now perfect for everyday use.
This application contains no ads, doesn't make any network requests and is Open Source."</string> -->
<string name="settings_activity_label">تنظیمات صفحه کلید غیرمنتظره</string> <string name="settings_activity_label">تنظیمات صفحه کلید غیرمنتظره</string>
<string name="pref_portrait">در حالت عمودی</string> <string name="pref_portrait">در حالت عمودی</string>
<string name="pref_landscape">در حالت افقی</string> <string name="pref_landscape">در حالت افقی</string>

View File

@@ -3,12 +3,7 @@
<string name="app_name_release">Unexpected Keyboard</string> <string name="app_name_release">Unexpected Keyboard</string>
<string name="app_name_debug">Unexpected Keyboard (debug)</string> <string name="app_name_debug">Unexpected Keyboard (debug)</string>
<string name="short_description">Clavier virtuel léger et respectueux de la vie privée pour Android.</string> <string name="short_description">Clavier virtuel léger et respectueux de la vie privée pour Android.</string>
<string name="store_description">"La fonctionnalité principale est l'accès rapide à plus de caractères en balayant les touches vers les coins. <string name="store_description">La fonctionnalité principale est l\'accès rapide à plus de caractères en balayant les touches vers les coins.\n\nCette application a été conçue à l\'origine pour les programmeurs utilisant Termux.\nElle est maintenant parfaite pour une utilisation quotidienne.\n\nCette application ne contient pas de publicité, n\'accède pas au réseau et est Open Source.</string>
Cette application a été conçue à l'origine pour les programmeurs utilisant Termux.
Elle est maintenant parfaite pour une utilisation quotidienne.
Cette application ne contient pas de publicité, n'accède pas au réseau et est Open Source."</string>
<string name="settings_activity_label">Unexpected Keyboard Paramètres</string> <string name="settings_activity_label">Unexpected Keyboard Paramètres</string>
<string name="pref_portrait">En mode portrait</string> <string name="pref_portrait">En mode portrait</string>
<string name="pref_landscape">En mode landscape</string> <string name="pref_landscape">En mode landscape</string>
@@ -66,12 +61,12 @@ Cette application ne contient pas de publicité, n'accède pas au réseau et est
<string name="pref_theme_e_altblack">Noir 2</string> <string name="pref_theme_e_altblack">Noir 2</string>
<string name="pref_theme_e_white">Blanc</string> <string name="pref_theme_e_white">Blanc</string>
<string name="pref_theme_e_epaper">ePaper</string> <string name="pref_theme_e_epaper">ePaper</string>
<string name="pref_theme_e_desert">Desert</string> <string name="pref_theme_e_desert">Désert</string>
<string name="pref_theme_e_jungle">Jungle</string> <string name="pref_theme_e_jungle">Jungle</string>
<string name="pref_theme_e_monet">Monet (Système)</string> <string name="pref_theme_e_monet">Monet (Système)</string>
<string name="pref_theme_e_monetlight">Monet (Clair)</string> <string name="pref_theme_e_monetlight">Monet (Clair)</string>
<string name="pref_theme_e_monetdark">Monet (Sombre)</string> <string name="pref_theme_e_monetdark">Monet (Sombre)</string>
<!-- <string name="pref_theme_e_rosepine">Rosé Pine</string> --> <string name="pref_theme_e_rosepine">Rosé Pine</string>
<string name="pref_swipe_dist_e_very_short">Très courte</string> <string name="pref_swipe_dist_e_very_short">Très courte</string>
<string name="pref_swipe_dist_e_short">Courte</string> <string name="pref_swipe_dist_e_short">Courte</string>
<string name="pref_swipe_dist_e_default">Normale</string> <string name="pref_swipe_dist_e_default">Normale</string>
@@ -88,7 +83,7 @@ Cette application ne contient pas de publicité, n'accède pas au réseau et est
<string name="pref_circle_sensitivity_e_low">Basse</string> <string name="pref_circle_sensitivity_e_low">Basse</string>
<string name="pref_circle_sensitivity_e_disabled">Désactivée</string> <string name="pref_circle_sensitivity_e_disabled">Désactivée</string>
<string name="key_action_next">Suiv.</string> <string name="key_action_next">Suiv.</string>
<string name="key_action_done">Fin</string> <string name="key_action_done">Fini</string>
<string name="key_action_go">Aller</string> <string name="key_action_go">Aller</string>
<string name="key_action_prev">Prec.</string> <string name="key_action_prev">Prec.</string>
<string name="key_action_search">Chercher</string> <string name="key_action_search">Chercher</string>
@@ -97,10 +92,10 @@ Cette application ne contient pas de publicité, n'accède pas au réseau et est
<string name="launcher_button_imepicker">Selectionner le keyboard</string> <string name="launcher_button_imepicker">Selectionner le keyboard</string>
<string name="launcher_description">Cette application est un clavier virtuel. Activez-le dans les paramètres système en cliquant sur le bouton ci-dessous.</string> <string name="launcher_description">Cette application est un clavier virtuel. Activez-le dans les paramètres système en cliquant sur le bouton ci-dessous.</string>
<string name="launcher_sourcecode">Cette application est libre et open-source. Lisez le source code et reportez des problèmes sur Github.</string> <string name="launcher_sourcecode">Cette application est libre et open-source. Lisez le source code et reportez des problèmes sur Github.</string>
<string name="launcher_tryhere">Après l\'avoir activé, vous pouvez l\'essayer ici:</string> <string name="launcher_tryhere">Après l\'avoir activé, vous pouvez l\'essayer ici :</string>
<string name="launcher_tryhere_hint">Essayer ici</string> <string name="launcher_tryhere_hint">Essayer ici</string>
<string name="key_descr_capslock">Verrouillage majuscules</string> <string name="key_descr_capslock">Verrouillage majuscules</string>
<string name="key_descr_compose">Compose</string> <string name="key_descr_compose">Composition</string>
<string name="key_descr_switch_greekmath">Symboles mathématiques</string> <string name="key_descr_switch_greekmath">Symboles mathématiques</string>
<string name="key_descr_change_method">Changer de clavier</string> <string name="key_descr_change_method">Changer de clavier</string>
<string name="key_descr_voice_typing">Saisie vocale</string> <string name="key_descr_voice_typing">Saisie vocale</string>
@@ -110,8 +105,8 @@ Cette application ne contient pas de publicité, n'accède pas au réseau et est
<string name="key_descr_selectAll">Sel. tout</string> <string name="key_descr_selectAll">Sel. tout</string>
<string name="key_descr_shareText">Partager</string> <string name="key_descr_shareText">Partager</string>
<string name="key_descr_pasteAsPlainText">Copier en texte brut</string> <string name="key_descr_pasteAsPlainText">Copier en texte brut</string>
<string name="key_descr_undo">Undo</string> <string name="key_descr_undo">Annuler</string>
<string name="key_descr_redo">Redo</string> <string name="key_descr_redo">Refaire</string>
<string name="key_descr_ª">Ordinal</string> <string name="key_descr_ª">Ordinal</string>
<string name="key_descr_º">Ordinal</string> <string name="key_descr_º">Ordinal</string>
<string name="key_descr_superscript">Exposant</string> <string name="key_descr_superscript">Exposant</string>
@@ -121,12 +116,12 @@ Cette application ne contient pas de publicité, n'accède pas au réseau et est
<string name="key_descr_home">Début</string> <string name="key_descr_home">Début</string>
<string name="key_descr_end">Fin</string> <string name="key_descr_end">Fin</string>
<string name="key_descr_clipboard">Presse-papiers</string> <string name="key_descr_clipboard">Presse-papiers</string>
<!-- <string name="key_descr_combining">Combining diacritic</string> --> <string name="key_descr_combining">Diacritique combinant</string>
<!-- <string name="key_descr_dead_key">Dead key</string> --> <string name="key_descr_dead_key">Touche morte</string>
<!-- <string name="key_descr_zwj">Zero width joiner</string> --> <string name="key_descr_zwj">Liant sans chasse</string>
<!-- <string name="key_descr_zwnj">Zero width non-joiner</string> --> <string name="key_descr_zwnj">Antiliant sans chasse</string>
<!-- <string name="key_descr_nbsp">Non-breaking space</string> --> <string name="key_descr_nbsp">Espace insécable</string>
<!-- <string name="key_descr_nnbsp">Narrow non-breaking space</string> --> <string name="key_descr_nnbsp">Espace fine insécable</string>
<!-- <string name="key_descr_delete_word">Delete a word</string> --> <!-- <string name="key_descr_delete_word">Delete a word</string> -->
<!-- <string name="key_descr_forward_delete_word">Delete a word on the right</string> --> <!-- <string name="key_descr_forward_delete_word">Delete a word on the right</string> -->
<!-- <string name="key_descr_gesture">Gesture</string> --> <!-- <string name="key_descr_gesture">Gesture</string> -->

View File

@@ -3,12 +3,7 @@
<string name="app_name_release">Unexpected Keyboard</string> <string name="app_name_release">Unexpected Keyboard</string>
<string name="app_name_debug">Unexpected Keyboard (debug)</string> <string name="app_name_debug">Unexpected Keyboard (debug)</string>
<string name="short_description">Una Tastiera Virtuale Leggera Per La Programmazione</string> <string name="short_description">Una Tastiera Virtuale Leggera Per La Programmazione</string>
<!-- <string name="store_description">"The main feature is that you can type more characters by swiping the keys towards the corners. <!-- <string name="store_description">The main feature is that you can type more characters by swiping the keys towards the corners.\n\nThis application was originally designed for programmers using Termux.\nNow perfect for everyday use.\n\nThis application contains no ads, doesn\'t make any network requests and is Open Source.</string> -->
This application was originally designed for programmers using Termux.
Now perfect for everyday use.
This application contains no ads, doesn't make any network requests and is Open Source."</string> -->
<string name="settings_activity_label">Impostazioni di Unexpected Keyboard</string> <string name="settings_activity_label">Impostazioni di Unexpected Keyboard</string>
<!-- <string name="pref_portrait">In portrait mode</string> --> <!-- <string name="pref_portrait">In portrait mode</string> -->
<!-- <string name="pref_landscape">In landscape mode</string> --> <!-- <string name="pref_landscape">In landscape mode</string> -->

View File

@@ -3,13 +3,7 @@
<string name="app_name_release">Unexpected Keyboard</string> <string name="app_name_release">Unexpected Keyboard</string>
<string name="app_name_debug">Unexpected Keyboard (Debug)</string> <string name="app_name_debug">Unexpected Keyboard (Debug)</string>
<string name="short_description">軽量でプライバシーに配慮したAndroid用仮想キーボード</string> <string name="short_description">軽量でプライバシーに配慮したAndroid用仮想キーボード</string>
<string name="store_description">"このキーボードは、キーの角をスワイプすることで様々なキーを入力できます。 <string name="store_description">このキーボードは、キーの角をスワイプすることで様々なキーを入力できます。\n\nこのアプリは元々はTermuxでのプログラミング用に設計されました。\nしかし、今では普段の入力にも適しています。\nPCキーボードでの半角入力を再現しています。日本語入力、変換は出来ません。\n\nこのアプリは広告を含まず、インターネットに接続せず、そしてオープンソースです。</string>
このアプリは元々はTermuxでのプログラミング用に設計されました。
しかし、今では普段の入力にも適しています。
PCキーボードでの半角入力を再現しています。日本語入力、変換は出来ません。
このアプリは広告を含まず、インターネットに接続せず、そしてオープンソースです。"</string>
<string name="settings_activity_label">Unexpected Keyboardの設定</string> <string name="settings_activity_label">Unexpected Keyboardの設定</string>
<string name="pref_portrait">縦向き</string> <string name="pref_portrait">縦向き</string>
<string name="pref_landscape">横向き</string> <string name="pref_landscape">横向き</string>

View File

@@ -3,12 +3,7 @@
<string name="app_name_release">Unexpected Keyboard</string> <string name="app_name_release">Unexpected Keyboard</string>
<!-- <string name="app_name_debug">Unexpected Keyboard (Debug)</string> --> <!-- <string name="app_name_debug">Unexpected Keyboard (Debug)</string> -->
<string name="short_description">개발자들을 위한 가벼운 가상 키보드.</string> <string name="short_description">개발자들을 위한 가벼운 가상 키보드.</string>
<string name="store_description">"주요 기능은 모서리 방향으로 키를 스와이프하여 더 많은 문자를 입력할 수 있다는 것입니다. <string name="store_description">주요 기능은 모서리 방향으로 키를 스와이프하여 더 많은 문자를 입력할 수 있다는 것입니다.\n\n이 앱은 처음에는 Termux를 사용하는 프로그래머들을 위한 것으로 개발되었습니다.\n지금은 일상적인 용도로도 완벽합니다.\n\n이 응용 프로그램에는 광고가 없으며 네트워크 요청을 하지 않고 오픈 소스입니다.</string>
이 앱은 처음에는 Termux를 사용하는 프로그래머들을 위한 것으로 개발되었습니다.
지금은 일상적인 용도로도 완벽합니다.
이 응용 프로그램에는 광고가 없으며 네트워크 요청을 하지 않고 오픈 소스입니다."</string>
<string name="settings_activity_label">Unexpected Keyboard 설정</string> <string name="settings_activity_label">Unexpected Keyboard 설정</string>
<string name="pref_portrait">세로 화면</string> <string name="pref_portrait">세로 화면</string>
<string name="pref_landscape">가로 화면</string> <string name="pref_landscape">가로 화면</string>

View File

@@ -3,12 +3,7 @@
<string name="app_name_release">Unexpected Keyboard</string> <string name="app_name_release">Unexpected Keyboard</string>
<string name="app_name_debug">Unexpected Keyboard (atkļūdošana)</string> <string name="app_name_debug">Unexpected Keyboard (atkļūdošana)</string>
<string name="short_description">Mazizmēra un privātumu ievērojoša virtuālā Android tastatūra.</string> <string name="short_description">Mazizmēra un privātumu ievērojoša virtuālā Android tastatūra.</string>
<string name="store_description">"Galvenā iezīme ir iespēja ievadīt vairāk rakstzīmju ar pavilkšanu uz taustiņu stūriem. <string name="store_description">Galvenā iezīme ir iespēja ievadīt vairāk rakstzīmju ar pavilkšanu uz taustiņu stūriem.\n\nŠī lietotne sākotnēji tika izstrādāta programmētājiem, kas izmanto Termux.\nTagad lieliski piemērota izmantošanai ikdienā.\n\nŠī lietotne nesatur reklāmas, neveic nekādus tīkla pieprasījumus, un tās pirmkods ir pieejams visiem.</string>
Šī lietotne sākotnēji tika izstrādāta programmētājiem, kas izmanto Termux.
Tagad lieliski piemērota izmantošanai ikdienā.
Šī lietotne nesatur reklāmas, neveic nekādus tīkla pieprasījumus, un tās pirmkods ir pieejams visiem."</string>
<string name="settings_activity_label">Unexpected Keyboard iestatījumi</string> <string name="settings_activity_label">Unexpected Keyboard iestatījumi</string>
<string name="pref_portrait">Stateniski</string> <string name="pref_portrait">Stateniski</string>
<string name="pref_landscape">Guleniski</string> <string name="pref_landscape">Guleniski</string>
@@ -95,10 +90,8 @@ Tagad lieliski piemērota izmantošanai ikdienā.
<string name="key_action_send">Sūtīt</string> <string name="key_action_send">Sūtīt</string>
<string name="launcher_button_imesettings">Iespējot tastatūru</string> <string name="launcher_button_imesettings">Iespējot tastatūru</string>
<string name="launcher_button_imepicker">Izvēlēties tastatūru</string> <string name="launcher_button_imepicker">Izvēlēties tastatūru</string>
<string name="launcher_description">Šī lietotne ir virtuālā tastatūra. <string name="launcher_description">Šī lietotne ir virtuālā tastatūra. Ar zemāk esošo pogu var atvērt sistēmas iestatījumus un iespējot Unexpected Keyboard.</string>
Ar zemāk esošo pogu var atvērt sistēmas iestatījumus un iespējot Unexpected Keyboard.</string> <string name="launcher_sourcecode">Šī ir bezmaksas un atvērtā pirmkoda lietotne. GitHub var atrast pirmkodu un ziņot par nepilnībām.</string>
<string name="launcher_sourcecode">Šī ir bezmaksas un atvērtā pirmkoda lietotne.
GitHub var atrast pirmkodu un ziņot par nepilnībām.</string>
<string name="launcher_tryhere">Pēc iespējošanas šeit var izmēģināt tastatūru:</string> <string name="launcher_tryhere">Pēc iespējošanas šeit var izmēģināt tastatūru:</string>
<string name="launcher_tryhere_hint">Izmēģināt šeit</string> <string name="launcher_tryhere_hint">Izmēģināt šeit</string>
<string name="key_descr_capslock">Burtslēgs</string> <string name="key_descr_capslock">Burtslēgs</string>

View File

@@ -3,12 +3,7 @@
<string name="app_name_release">Unexpected Keyboard</string> <string name="app_name_release">Unexpected Keyboard</string>
<string name="app_name_debug">Unexpected Keyboard (debug)</string> <string name="app_name_debug">Unexpected Keyboard (debug)</string>
<string name="short_description">Lekka i dbająca o prywatność klawiatura wirtualna dla Androida.</string> <string name="short_description">Lekka i dbająca o prywatność klawiatura wirtualna dla Androida.</string>
<string name="store_description">"Główną cechą tej klawiatury jest możliwość wprowadzania więcej znaków poprzez przesuwanie po klawiszach do ich rogów. <string name="store_description">Główną cechą tej klawiatury jest możliwość wprowadzania więcej znaków poprzez przesuwanie po klawiszach do ich rogów.\n\nTa aplikacja została pierwotnie zaprojektowana z myślą o programistach używających Termuxa.\nObecnie nadaje się doskonale do codziennego użytku.\n\nAplikacja nie zawiera reklam, nie żąda dostępu do internetu, a jej kod źródłowy jest dostępny publicznie.</string>
Ta aplikacja została pierwotnie zaprojektowana z myślą o programistach używających Termuxa.
Obecnie nadaje się doskonale do codziennego użytku.
Aplikacja nie zawiera reklam, nie żąda dostępu do internetu, a jej kod źródłowy jest dostępny publicznie."</string>
<string name="settings_activity_label">Ustawienia Unexpected Keyboard</string> <string name="settings_activity_label">Ustawienia Unexpected Keyboard</string>
<string name="pref_portrait">W widoku pionowym</string> <string name="pref_portrait">W widoku pionowym</string>
<string name="pref_landscape">W widoku poziomym</string> <string name="pref_landscape">W widoku poziomym</string>

View File

@@ -3,12 +3,7 @@
<string name="app_name_release">Teclado Unexpected</string> <string name="app_name_release">Teclado Unexpected</string>
<string name="app_name_debug">Teclado Unexpected</string> <string name="app_name_debug">Teclado Unexpected</string>
<string name="short_description">Um teclado virtual leve para desenvolvedores.</string> <string name="short_description">Um teclado virtual leve para desenvolvedores.</string>
<string name="store_description">"A principal característica é que você pode digitar mais caracteres deslizando as teclas para os cantos. <string name="store_description">A principal característica é que você pode digitar mais caracteres deslizando as teclas para os cantos.\n\nO app foi criado originalmente para desenvolvedores que usam Termux.\nAgora aperfeiçoado para o uso diário.\n\nEste aplicativo não contém anúncios, não faz nenhuma solicitação de rede e é Open Source.</string>
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."</string>
<string name="settings_activity_label">Configurações</string> <string name="settings_activity_label">Configurações</string>
<string name="pref_portrait">No modo retrato</string> <string name="pref_portrait">No modo retrato</string>
<string name="pref_landscape">No modo paisagem</string> <string name="pref_landscape">No modo paisagem</string>

View File

@@ -3,12 +3,7 @@
<string name="app_name_release">Unexpected Keyboard</string> <string name="app_name_release">Unexpected Keyboard</string>
<string name="app_name_debug">Tastatură Unexpected (depanare)</string> <string name="app_name_debug">Tastatură Unexpected (depanare)</string>
<string name="short_description">Tastatură virtuală pentru Android, ușoară și respectuoasă cu viața privată.</string> <string name="short_description">Tastatură virtuală pentru Android, ușoară și respectuoasă cu viața privată.</string>
<string name="store_description">"Funcționalitatea principală este accesul rapid la o mulțime de caractere ASCII prin glisarea către colțurile tastelor. <string name="store_description">Funcționalitatea principală este accesul rapid la o mulțime de caractere ASCII prin glisarea către colțurile tastelor.\n\nAceastă aplicație a fost concepută inițial pentru programatori care folosec Termux.\nEste perfectă pentru uzul cotidian.\n\nAceastă aplicație nu conține publicitate, nu folosește rețeaua deloc și e Open Source.</string>
Această aplicație a fost concepută inițial pentru programatori care folosec Termux.
Este perfectă pentru uzul cotidian.
Această aplicație nu conține publicitate, nu folosește rețeaua deloc și e Open Source."</string>
<string name="settings_activity_label">Setări Tastatură Unexpected</string> <string name="settings_activity_label">Setări Tastatură Unexpected</string>
<string name="pref_portrait">În mod portret</string> <string name="pref_portrait">În mod portret</string>
<string name="pref_landscape">În mod panoramă</string> <string name="pref_landscape">În mod panoramă</string>

View File

@@ -3,12 +3,7 @@
<string name="app_name_release">Unexpected Keyboard</string> <string name="app_name_release">Unexpected Keyboard</string>
<string name="app_name_debug">Unexpected Keyboard (отладка)</string> <string name="app_name_debug">Unexpected Keyboard (отладка)</string>
<string name="short_description">Легкая клавиатура для пользователей, заботящихся о конфиденциальности.</string> <string name="short_description">Легкая клавиатура для пользователей, заботящихся о конфиденциальности.</string>
<string name="store_description">"Главная особенность клавиатуры — это возможность легко напечатать любой ASCII-символ жестами в углы клавиш. <string name="store_description">Главная особенность клавиатуры — это возможность легко напечатать любой ASCII-символ жестами в углы клавиш.\n\nПриложение изначально было разработано для использования с Termux.\nНа данный момент оно также удобно в повседневном использовании.\n\nПриложение не содержит рекламы, не осуществляет никаких запросов в сеть и имеет открытый исходный код.</string>
Приложение изначально было разработано для использования с Termux.
На данный момент оно также удобно в повседневном использовании.
Приложение не содержит рекламы, не осуществляет никаких запросов в сеть и имеет открытый исходный код."</string>
<string name="settings_activity_label">Настройки Unexpected Keyboard</string> <string name="settings_activity_label">Настройки Unexpected Keyboard</string>
<string name="pref_portrait">В портретном режиме</string> <string name="pref_portrait">В портретном режиме</string>
<string name="pref_landscape">В ландшафтном режиме</string> <string name="pref_landscape">В ландшафтном режиме</string>

View File

@@ -3,12 +3,7 @@
<string name="app_name_release">Unexpected Keyboard</string> <string name="app_name_release">Unexpected Keyboard</string>
<string name="app_name_debug">Unexpected Keyboard (debug)</string> <string name="app_name_debug">Unexpected Keyboard (debug)</string>
<string name="short_description">Android için hafif ve güvenlik odaklı bir sanal klavye uygulaması.</string> <string name="short_description">Android için hafif ve güvenlik odaklı bir sanal klavye uygulaması.</string>
<string name="store_description">"Bu uygulama özünde tuşların kenarlarından kaydırarak daha fazla karakter yazabilmek amacıyla geliştirildi. <string name="store_description">Bu uygulama özünde tuşların kenarlarından kaydırarak daha fazla karakter yazabilmek amacıyla geliştirildi.\n\nBu uygulama aslında Termux kullanıcıları için geliştirildi.\nArtık gündelik kullanım için de uygun.\n\nBu uygulama açık kaynaklıdır. Reklam içermez ve internete bağlanmaz.</string>
Bu uygulama aslında Termux kullanıcıları için geliştirildi.
Artık gündelik kullanım için de uygun.
Bu uygulama açık kaynaklıdır. Reklam içermez ve internete bağlanmaz."</string>
<string name="settings_activity_label">Unexpected Keyboard Ayarları</string> <string name="settings_activity_label">Unexpected Keyboard Ayarları</string>
<string name="pref_portrait">Portre modunda</string> <string name="pref_portrait">Portre modunda</string>
<string name="pref_landscape">Manzara modunda</string> <string name="pref_landscape">Manzara modunda</string>

View File

@@ -3,12 +3,7 @@
<string name="app_name_release">Unexpected Keyboard</string> <string name="app_name_release">Unexpected Keyboard</string>
<string name="app_name_debug">Unexpected Keyboard (Налагодження)</string> <string name="app_name_debug">Unexpected Keyboard (Налагодження)</string>
<string name="short_description">Легка та конфіденційна віртуальна клавіатура для Android.</string> <string name="short_description">Легка та конфіденційна віртуальна клавіатура для Android.</string>
<string name="store_description">"Головна особливість полягає в тому, що ви можете вводити більше символів, проводячи клавіші до кутів. <string name="store_description">Головна особливість полягає в тому, що ви можете вводити більше символів, проводячи клавіші до кутів.\n\nЦя програма спочатку була розроблена для програмістів, які використовують Termux.\nТепер ідеально підходить для щоденного використання.\n\nЦя програма не містить реклами, не надсилає жодних мережевих запитів і має відкритий код.</string>
Ця програма спочатку була розроблена для програмістів, які використовують Termux.
Тепер ідеально підходить для щоденного використання.
Ця програма не містить реклами, не надсилає жодних мережевих запитів і має відкритий код."</string>
<string name="settings_activity_label">Unexpected Keyboard Налаштування</string> <string name="settings_activity_label">Unexpected Keyboard Налаштування</string>
<string name="pref_portrait">У портретному режимі</string> <string name="pref_portrait">У портретному режимі</string>
<string name="pref_landscape">У альбомному режимі</string> <string name="pref_landscape">У альбомному режимі</string>
@@ -23,7 +18,7 @@
<string name="pref_layouts_item">Макет %1$d: %2$s</string> <string name="pref_layouts_item">Макет %1$d: %2$s</string>
<string name="pref_layouts_remove_custom">Видалити макет</string> <string name="pref_layouts_remove_custom">Видалити макет</string>
<string name="pref_custom_layout_title">Власний макет</string> <string name="pref_custom_layout_title">Власний макет</string>
<string name="pref_show_numpad_title">Показувати числову клавіатуру </string> <string name="pref_show_numpad_title">Показувати числову клавіатуру</string>
<string name="pref_show_numpad_never">Ніколи</string> <string name="pref_show_numpad_never">Ніколи</string>
<string name="pref_show_numpad_landscape">Тільки в альбомному режимі</string> <string name="pref_show_numpad_landscape">Тільки в альбомному режимі</string>
<string name="pref_show_numpad_always">Завжди</string> <string name="pref_show_numpad_always">Завжди</string>

View File

@@ -3,12 +3,7 @@
<string name="app_name_release">Unexpected Keyboard</string> <string name="app_name_release">Unexpected Keyboard</string>
<string name="app_name_debug">Unexpected Keyboard (gỡ lỗi)</string> <string name="app_name_debug">Unexpected Keyboard (gỡ lỗi)</string>
<string name="short_description">Bàn phím ảo gọn nhẹ và tôn trọng quyền riêng tư cho Android.</string> <string name="short_description">Bàn phím ảo gọn nhẹ và tôn trọng quyền riêng tư cho Android.</string>
<string name="store_description">"Chức năng chính là dễ dàng gõ nhiều ký tự bằng cách kéo phím về góc của nó. <string name="store_description">Chức năng chính là dễ dàng gõ nhiều ký tự bằng cách kéo phím về góc của nó.\n\nỨng dụng này ban đầu được thiết kế cho các lập trình viên dùng Termux.\nBây giờ đã hoàn hảo cho việc sử dụng hàng ngày.\n\nỨng dụng này không chứa quảng cáo, không cần đến mạng, và có mã nguồn mở.</string>
Ứng dụng này ban đầu được thiết kế cho các lập trình viên dùng Termux.
Bây giờ đã hoàn hảo cho việc sử dụng hàng ngày.
Ứng dụng này không chứa quảng cáo, không cần đến mạng, và có mã nguồn mở."</string>
<string name="settings_activity_label">Cài đặt Unexpected Keyboard</string> <string name="settings_activity_label">Cài đặt Unexpected Keyboard</string>
<string name="pref_portrait">Trong chế độ chân dung</string> <string name="pref_portrait">Trong chế độ chân dung</string>
<string name="pref_landscape">Trong chế độ phong cảnh</string> <string name="pref_landscape">Trong chế độ phong cảnh</string>

View File

@@ -3,12 +3,7 @@
<string name="app_name_release">Unexpected Keyboard</string> <string name="app_name_release">Unexpected Keyboard</string>
<string name="app_name_debug">Unexpected Keyboard (debug)</string> <string name="app_name_debug">Unexpected Keyboard (debug)</string>
<string name="short_description">适用于 Android 的轻量级、注重隐私的虚拟键盘。</string> <string name="short_description">适用于 Android 的轻量级、注重隐私的虚拟键盘。</string>
<string name="store_description">"此应用的主要功能是,通过将按键沿四角滑动,您可以输入更多字符。 <string name="store_description">此应用的主要功能是,通过将按键沿四角滑动,您可以输入更多字符。\n\n此应用最初是为使用 Termux 的程序员而设计的。\n现在对于日常使用来说也很完美。\n\n此应用没有广告不会发送任何网络请求而且是开源的。</string>
此应用最初是为使用 Termux 的程序员而设计的。
现在对于日常使用来说也很完美。
此应用没有广告,不会发送任何网络请求,而且是开源的。"</string>
<string name="settings_activity_label">Unexpected Keyboard 设置</string> <string name="settings_activity_label">Unexpected Keyboard 设置</string>
<string name="pref_portrait">在竖屏模式下</string> <string name="pref_portrait">在竖屏模式下</string>
<string name="pref_landscape">在横屏模式下</string> <string name="pref_landscape">在横屏模式下</string>

View File

@@ -3,12 +3,7 @@
<string name="app_name_release">Unexpected Keyboard</string> <string name="app_name_release">Unexpected Keyboard</string>
<string name="app_name_debug">Unexpected Keyboard (Debug)</string> <string name="app_name_debug">Unexpected Keyboard (Debug)</string>
<string name="short_description">Lightweight and privacy-conscious virtual keyboard for Android.</string> <string name="short_description">Lightweight and privacy-conscious virtual keyboard for Android.</string>
<string name="store_description">"The main feature is that you can type more characters by swiping the keys towards the corners. <string name="store_description">The main feature is that you can type more characters by swiping the keys towards the corners.\n\nThis application was originally designed for programmers using Termux.\nNow perfect for everyday use.\n\nThis application contains no ads, doesn\'t make any network requests and is Open Source.</string>
This application was originally designed for programmers using Termux.
Now perfect for everyday use.
This application contains no ads, doesn't make any network requests and is Open Source."</string>
<string name="settings_activity_label">Unexpected Keyboard Settings</string> <string name="settings_activity_label">Unexpected Keyboard Settings</string>
<string name="pref_portrait">In portrait mode</string> <string name="pref_portrait">In portrait mode</string>
<string name="pref_landscape">In landscape mode</string> <string name="pref_landscape">In landscape mode</string>

View File

@@ -181,27 +181,27 @@
</style> </style>
<style name="MonetLight" parent="@style/BaseTheme"> <style name="MonetLight" parent="@style/BaseTheme">
<item name="android:isLightTheme">true</item> <item name="android:isLightTheme">true</item>
<item name="colorKeyboard">@android:color/system_accent1_100</item> <item name="colorKeyboard">@android:color/system_neutral1_100</item>
<item name="colorKey">@android:color/system_accent1_0</item> <item name="colorKey">@android:color/system_neutral1_50</item>
<item name="colorKeyActivated">@android:color/system_accent1_300</item> <item name="colorKeyActivated">?colorKeyboard</item>
<item name="colorLabel">@android:color/system_accent1_1000</item> <item name="colorLabel">@android:color/system_neutral1_800</item>
<item name="colorLabelActivated">@android:color/system_accent1_1000</item> <item name="colorLabelActivated">@android:color/system_accent1_400</item>
<item name="colorLabelLocked">@android:color/system_accent1_500</item> <item name="colorLabelLocked">@android:color/system_accent1_600</item>
<item name="colorSubLabel">@android:color/system_accent1_900</item> <item name="colorSubLabel">@android:color/system_neutral1_500</item>
<item name="emoji_button_bg">?colorKeyActivated</item> <item name="emoji_button_bg">?colorKeyActivated</item>
<item name="emoji_color">@android:color/system_accent1_1000</item> <item name="emoji_color">?colorKeyboard</item>
</style> </style>
<style name="MonetDark" parent="@style/BaseTheme"> <style name="MonetDark" parent="@style/BaseTheme">
<item name="android:isLightTheme">false</item> <item name="android:isLightTheme">false</item>
<item name="colorKeyboard">@android:color/system_neutral1_900</item> <item name="colorKeyboard">@android:color/system_neutral1_900</item>
<item name="colorKey">@android:color/system_accent2_800</item> <item name="colorKey">@android:color/system_neutral1_800</item>
<item name="colorKeyActivated">@android:color/system_accent1_800</item> <item name="colorKeyActivated">?colorKeyboard</item>
<item name="colorLabel">@android:color/system_neutral1_0</item> <item name="colorLabel">@android:color/system_neutral1_0</item>
<item name="colorLabelActivated">@android:color/system_accent1_400</item> <item name="colorLabelActivated">@android:color/system_accent1_400</item>
<item name="colorLabelLocked">@android:color/system_accent1_100</item> <item name="colorLabelLocked">@android:color/system_accent1_600</item>
<item name="colorSubLabel">@android:color/system_neutral1_300</item> <item name="colorSubLabel">@android:color/system_neutral1_400</item>
<item name="emoji_button_bg">?colorKeyActivated</item> <item name="emoji_button_bg">?colorKeyActivated</item>
<item name="emoji_color">@android:color/system_neutral1_900</item> <item name="emoji_color">?colorKeyboard</item>
</style> </style>
<style name="RosePine" parent="BaseTheme"> <style name="RosePine" parent="BaseTheme">
<item name="android:isLightTheme">false</item> <item name="android:isLightTheme">false</item>

View File

@@ -1,7 +1,6 @@
package juloo.keyboard2; package juloo.keyboard2;
import android.os.Handler; import android.os.Handler;
import android.os.Looper;
import android.text.InputType; import android.text.InputType;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.inputmethod.EditorInfo; import android.view.inputmethod.EditorInfo;
@@ -27,9 +26,9 @@ public final class Autocapitalisation
InputType.TYPE_TEXT_FLAG_CAP_SENTENCES | InputType.TYPE_TEXT_FLAG_CAP_SENTENCES |
InputType.TYPE_TEXT_FLAG_CAP_WORDS; InputType.TYPE_TEXT_FLAG_CAP_WORDS;
public Autocapitalisation(Looper looper, Callback cb) public Autocapitalisation(Handler h, Callback cb)
{ {
_handler = new Handler(looper); _handler = h;
_callback = cb; _callback = cb;
} }

View File

@@ -2,6 +2,7 @@ package juloo.keyboard2;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.os.Looper; import android.os.Looper;
import android.os.Handler;
import android.text.InputType; import android.text.InputType;
import android.view.KeyCharacterMap; import android.view.KeyCharacterMap;
import android.view.KeyEvent; import android.view.KeyEvent;
@@ -28,10 +29,10 @@ public final class KeyEventHandler
[setSelection] could be used instead. */ [setSelection] could be used instead. */
boolean _move_cursor_force_fallback = false; boolean _move_cursor_force_fallback = false;
public KeyEventHandler(Looper looper, IReceiver recv) public KeyEventHandler(IReceiver recv)
{ {
_recv = recv; _recv = recv;
_autocap = new Autocapitalisation(looper, _autocap = new Autocapitalisation(recv.getHandler(),
this.new Autocapitalisation_callback()); this.new Autocapitalisation_callback());
_mods = Pointers.Modifiers.EMPTY; _mods = Pointers.Modifiers.EMPTY;
} }
@@ -241,6 +242,7 @@ public final class KeyEventHandler
case AUTOFILL: send_context_menu_action(android.R.id.autofill); break; case AUTOFILL: send_context_menu_action(android.R.id.autofill); break;
case DELETE_WORD: send_key_down_up(KeyEvent.KEYCODE_DEL, KeyEvent.META_CTRL_ON | KeyEvent.META_CTRL_LEFT_ON); break; case DELETE_WORD: send_key_down_up(KeyEvent.KEYCODE_DEL, KeyEvent.META_CTRL_ON | KeyEvent.META_CTRL_LEFT_ON); break;
case FORWARD_DELETE_WORD: send_key_down_up(KeyEvent.KEYCODE_FORWARD_DEL, KeyEvent.META_CTRL_ON | KeyEvent.META_CTRL_LEFT_ON); break; case FORWARD_DELETE_WORD: send_key_down_up(KeyEvent.KEYCODE_FORWARD_DEL, KeyEvent.META_CTRL_ON | KeyEvent.META_CTRL_LEFT_ON); break;
case SELECTION_CANCEL: cancel_selection(); break;
} }
} }
@@ -258,15 +260,17 @@ public final class KeyEventHandler
return conn.getExtractedText(_move_cursor_req, 0); return conn.getExtractedText(_move_cursor_req, 0);
} }
/** [repeatition] might be negative, in which case the direction is reversed. */ /** [r] might be negative, in which case the direction is reversed. */
void handle_slider(KeyValue.Slider s, int repeatition) void handle_slider(KeyValue.Slider s, int r)
{ {
switch (s) switch (s)
{ {
case Cursor_left: move_cursor(-repeatition); break; case Cursor_left: move_cursor(-r); break;
case Cursor_right: move_cursor(repeatition); break; case Cursor_right: move_cursor(r); break;
case Cursor_up: move_cursor_vertical(-repeatition); break; case Cursor_up: move_cursor_vertical(-r); break;
case Cursor_down: move_cursor_vertical(repeatition); break; case Cursor_down: move_cursor_vertical(r); break;
case Selection_cursor_left: move_cursor_sel(r, true); break;
case Selection_cursor_right: move_cursor_sel(r, false); break;
} }
} }
@@ -280,12 +284,7 @@ public final class KeyEventHandler
if (conn == null) if (conn == null)
return; return;
ExtractedText et = get_cursor_pos(conn); ExtractedText et = get_cursor_pos(conn);
int system_mods = if (et != null && can_set_selection(conn))
KeyEvent.META_CTRL_ON | KeyEvent.META_ALT_ON | KeyEvent.META_META_ON;
// Fallback to sending key events if system modifiers are activated or
// ExtractedText is not supported, for example on Termux.
if (!_move_cursor_force_fallback && et != null
&& (_meta_state & system_mods) == 0)
{ {
int sel_start = et.selectionStart; int sel_start = et.selectionStart;
int sel_end = et.selectionEnd; int sel_end = et.selectionEnd;
@@ -304,8 +303,45 @@ public final class KeyEventHandler
sel_start = sel_end; sel_start = sel_end;
} }
if (conn.setSelection(sel_start, sel_end)) if (conn.setSelection(sel_start, sel_end))
return; // [setSelection] succeeded, don't fallback to key events return; // Fallback to sending key events if [setSelection] failed
} }
move_cursor_fallback(d);
}
/** Move one of the two side of a selection. If [sel_left] is true, the left
position is moved, otherwise the right position is moved. */
void move_cursor_sel(int d, boolean sel_left)
{
InputConnection conn = _recv.getCurrentInputConnection();
if (conn == null)
return;
ExtractedText et = get_cursor_pos(conn);
if (et != null && can_set_selection(conn))
{
int sel_start = et.selectionStart;
int sel_end = et.selectionEnd;
if (sel_left == (sel_start <= sel_end))
sel_start += d;
else
sel_end += d;
if (conn.setSelection(sel_start, sel_end))
return; // Fallback to sending key events if [setSelection] failed
}
move_cursor_fallback(d);
}
/** Returns whether the selection can be set using [conn.setSelection()].
This can happen on Termux or when system modifiers are activated for
example. */
boolean can_set_selection(InputConnection conn)
{
final int system_mods =
KeyEvent.META_CTRL_ON | KeyEvent.META_ALT_ON | KeyEvent.META_META_ON;
return !_move_cursor_force_fallback && (_meta_state & system_mods) == 0;
}
void move_cursor_fallback(int d)
{
if (d < 0) if (d < 0)
send_key_down_up_repeat(KeyEvent.KEYCODE_DPAD_LEFT, -d); send_key_down_up_repeat(KeyEvent.KEYCODE_DPAD_LEFT, -d);
else else
@@ -324,32 +360,73 @@ public final class KeyEventHandler
void evaluate_macro(KeyValue[] keys) void evaluate_macro(KeyValue[] keys)
{ {
final Pointers.Modifiers empty = Pointers.Modifiers.EMPTY; if (keys.length == 0)
return;
// Ignore modifiers that are activated at the time the macro is evaluated // Ignore modifiers that are activated at the time the macro is evaluated
mods_changed(empty); mods_changed(Pointers.Modifiers.EMPTY);
Pointers.Modifiers mods = empty; evaluate_macro_loop(keys, 0, Pointers.Modifiers.EMPTY, _autocap.pause());
final boolean autocap_paused = _autocap.pause(); }
for (KeyValue kv : keys)
/** Evaluate the macro asynchronously to make sure event are processed in the
right order. */
void evaluate_macro_loop(final KeyValue[] keys, int i, Pointers.Modifiers mods, final boolean autocap_paused)
{
boolean should_delay = false;
KeyValue kv = KeyModifier.modify(keys[i], mods);
if (kv != null)
{ {
kv = KeyModifier.modify(kv, mods);
if (kv == null)
continue;
if (kv.hasFlagsAny(KeyValue.FLAG_LATCH)) if (kv.hasFlagsAny(KeyValue.FLAG_LATCH))
{ {
// Non-special latchable keys clear latched modifiers // Non-special latchable keys clear latched modifiers
if (!kv.hasFlagsAny(KeyValue.FLAG_SPECIAL)) if (!kv.hasFlagsAny(KeyValue.FLAG_SPECIAL))
mods = empty; mods = Pointers.Modifiers.EMPTY;
mods = mods.with_extra_mod(kv); mods = mods.with_extra_mod(kv);
} }
else else
{ {
key_down(kv, false); key_down(kv, false);
key_up(kv, mods); key_up(kv, mods);
mods = empty; mods = Pointers.Modifiers.EMPTY;
} }
should_delay = wait_after_macro_key(kv);
} }
i++;
if (i >= keys.length) // Stop looping
{
_autocap.unpause(autocap_paused); _autocap.unpause(autocap_paused);
} }
else if (should_delay)
{
// Add a delay before sending the next key to avoid race conditions
// causing keys to be handled in the wrong order. Notably, KeyEvent keys
// handling is scheduled differently than the other edit functions.
final int i_ = i;
final Pointers.Modifiers mods_ = mods;
_recv.getHandler().postDelayed(new Runnable() {
public void run()
{
evaluate_macro_loop(keys, i_, mods_, autocap_paused);
}
}, 1000/30);
}
else
evaluate_macro_loop(keys, i, mods, autocap_paused);
}
boolean wait_after_macro_key(KeyValue kv)
{
switch (kv.getKind())
{
case Keyevent:
case Editing:
case Event:
return true;
case Slider:
return _move_cursor_force_fallback;
default:
return false;
}
}
/** Repeat calls to [send_key_down_up]. */ /** Repeat calls to [send_key_down_up]. */
void send_key_down_up_repeat(int event_code, int repeat) void send_key_down_up_repeat(int event_code, int repeat)
@@ -358,12 +435,27 @@ public final class KeyEventHandler
send_key_down_up(event_code); send_key_down_up(event_code);
} }
void cancel_selection()
{
InputConnection conn = _recv.getCurrentInputConnection();
if (conn == null)
return;
ExtractedText et = get_cursor_pos(conn);
if (et == null) return;
final int curs = et.selectionStart;
// Notify the receiver as Android's [onUpdateSelection] is not triggered.
if (conn.setSelection(curs, curs));
_recv.selection_state_changed(false);
}
public static interface IReceiver public static interface IReceiver
{ {
public void handle_event_key(KeyValue.Event ev); public void handle_event_key(KeyValue.Event ev);
public void set_shift_state(boolean state, boolean lock); public void set_shift_state(boolean state, boolean lock);
public void set_compose_pending(boolean pending); public void set_compose_pending(boolean pending);
public void selection_state_changed(boolean selection_is_ongoing);
public InputConnection getCurrentInputConnection(); public InputConnection getCurrentInputConnection();
public Handler getHandler();
} }
class Autocapitalisation_callback implements Autocapitalisation.Callback class Autocapitalisation_callback implements Autocapitalisation.Callback

View File

@@ -82,6 +82,7 @@ public final class KeyModifier
case HOOK_ABOVE: return apply_compose(k, ComposeKeyData.accent_hook_above); case HOOK_ABOVE: return apply_compose(k, ComposeKeyData.accent_hook_above);
case DOUBLE_GRAVE: return apply_compose(k, ComposeKeyData.accent_double_grave); case DOUBLE_GRAVE: return apply_compose(k, ComposeKeyData.accent_double_grave);
case ARROW_RIGHT: return apply_combining_char(k, "\u20D7"); case ARROW_RIGHT: return apply_combining_char(k, "\u20D7");
case SELECTION_MODE: return apply_selection_mode(k);
default: return k; default: return k;
} }
} }
@@ -392,6 +393,34 @@ public final class KeyModifier
return (name == null) ? k : KeyValue.getKeyByName(name); return (name == null) ? k : KeyValue.getKeyByName(name);
} }
private static KeyValue apply_selection_mode(KeyValue k)
{
String name = null;
switch (k.getKind())
{
case Char:
switch (k.getChar())
{
case ' ': name = "selection_cancel"; break;
}
break;
case Slider:
switch (k.getSlider())
{
case Cursor_left: name = "selection_cursor_left"; break;
case Cursor_right: name = "selection_cursor_right"; break;
}
break;
case Keyevent:
switch (k.getKeyevent())
{
case KeyEvent.KEYCODE_ESCAPE: name = "selection_cancel"; break;
}
break;
}
return (name == null) ? k : KeyValue.getKeyByName(name);
}
/** Compose the precomposed initial with the medial [kv]. */ /** Compose the precomposed initial with the medial [kv]. */
private static KeyValue combine_hangul_initial(KeyValue kv, int precomposed) private static KeyValue combine_hangul_initial(KeyValue kv, int precomposed)
{ {

View File

@@ -59,6 +59,7 @@ public final class KeyValue implements Comparable<KeyValue>
BREVE, BREVE,
BAR, BAR,
FN, FN,
SELECTION_MODE,
} // Last is be applied first } // Last is be applied first
public static enum Editing public static enum Editing
@@ -77,6 +78,7 @@ public final class KeyValue implements Comparable<KeyValue>
AUTOFILL, AUTOFILL,
DELETE_WORD, DELETE_WORD,
FORWARD_DELETE_WORD, FORWARD_DELETE_WORD,
SELECTION_CANCEL,
} }
public static enum Placeholder public static enum Placeholder
@@ -715,6 +717,9 @@ public final class KeyValue implements Comparable<KeyValue>
case "cursor_right": return sliderKey(Slider.Cursor_right, 1); case "cursor_right": return sliderKey(Slider.Cursor_right, 1);
case "cursor_up": return sliderKey(Slider.Cursor_up, 1); case "cursor_up": return sliderKey(Slider.Cursor_up, 1);
case "cursor_down": return sliderKey(Slider.Cursor_down, 1); case "cursor_down": return sliderKey(Slider.Cursor_down, 1);
case "selection_cancel": return editingKey("Esc", Editing.SELECTION_CANCEL, FLAG_SMALLER_FONT);
case "selection_cursor_left": return sliderKey(Slider.Selection_cursor_left, -1); // Move the left side of the selection
case "selection_cursor_right": return sliderKey(Slider.Selection_cursor_right, 1);
// These keys are not used // These keys are not used
case "replaceText": return editingKey("repl", Editing.REPLACE); case "replaceText": return editingKey("repl", Editing.REPLACE);
case "textAssist": return editingKey(0xE038, Editing.ASSIST); case "textAssist": return editingKey(0xE038, Editing.ASSIST);
@@ -764,6 +769,9 @@ public final class KeyValue implements Comparable<KeyValue>
case "": case "": case "": case "":
return makeStringKey(name, FLAG_SMALLER_FONT); return makeStringKey(name, FLAG_SMALLER_FONT);
/* Internal keys */
case "selection_mode": return makeInternalModifier(Modifier.SELECTION_MODE);
default: return null; default: return null;
} }
} }
@@ -780,7 +788,9 @@ public final class KeyValue implements Comparable<KeyValue>
Cursor_left(0xE008), Cursor_left(0xE008),
Cursor_right(0xE006), Cursor_right(0xE006),
Cursor_up(0xE005), Cursor_up(0xE005),
Cursor_down(0xE007); Cursor_down(0xE007),
Selection_cursor_left(0xE008),
Selection_cursor_right(0xE006);
final String symbol; final String symbol;

View File

@@ -6,6 +6,7 @@ import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.inputmethodservice.InputMethodService; import android.inputmethodservice.InputMethodService;
import android.os.Build.VERSION; import android.os.Build.VERSION;
import android.os.Handler;
import android.os.IBinder; import android.os.IBinder;
import android.text.InputType; import android.text.InputType;
import android.util.Log; import android.util.Log;
@@ -38,6 +39,7 @@ public class Keyboard2 extends InputMethodService
private ViewGroup _emojiPane = null; private ViewGroup _emojiPane = null;
private ViewGroup _clipboard_pane = null; private ViewGroup _clipboard_pane = null;
public int actionId; // Action performed by the Action key. public int actionId; // Action performed by the Action key.
private Handler _handler;
private Config _config; private Config _config;
@@ -107,7 +109,8 @@ public class Keyboard2 extends InputMethodService
{ {
super.onCreate(); super.onCreate();
SharedPreferences prefs = DirectBootAwarePreferences.get_shared_preferences(this); SharedPreferences prefs = DirectBootAwarePreferences.get_shared_preferences(this);
_keyeventhandler = new KeyEventHandler(getMainLooper(), this.new Receiver()); _handler = new Handler(getMainLooper());
_keyeventhandler = new KeyEventHandler(this.new Receiver());
Config.initGlobalConfig(prefs, getResources(), _keyeventhandler); Config.initGlobalConfig(prefs, getResources(), _keyeventhandler);
prefs.registerOnSharedPreferenceChangeListener(this); prefs.registerOnSharedPreferenceChangeListener(this);
_config = Config.globalConfig(); _config = Config.globalConfig();
@@ -359,6 +362,8 @@ public class Keyboard2 extends InputMethodService
{ {
super.onUpdateSelection(oldSelStart, oldSelEnd, newSelStart, newSelEnd, candidatesStart, candidatesEnd); super.onUpdateSelection(oldSelStart, oldSelEnd, newSelStart, newSelEnd, candidatesStart, candidatesEnd);
_keyeventhandler.selection_updated(oldSelStart, newSelStart); _keyeventhandler.selection_updated(oldSelStart, newSelStart);
if ((oldSelStart == oldSelEnd) != (newSelStart == newSelEnd))
_keyboardView.set_selection_state(newSelStart != newSelEnd);
} }
@Override @Override
@@ -477,10 +482,20 @@ public class Keyboard2 extends InputMethodService
_keyboardView.set_compose_pending(pending); _keyboardView.set_compose_pending(pending);
} }
public void selection_state_changed(boolean selection_is_ongoing)
{
_keyboardView.set_selection_state(selection_is_ongoing);
}
public InputConnection getCurrentInputConnection() public InputConnection getCurrentInputConnection()
{ {
return Keyboard2.this.getCurrentInputConnection(); return Keyboard2.this.getCurrentInputConnection();
} }
public Handler getHandler()
{
return _handler;
}
} }
private IBinder getConnectionToken() private IBinder getConnectionToken()

View File

@@ -139,6 +139,13 @@ public class Keyboard2View extends View
set_fake_ptr_latched(_compose_key, _compose_kv, pending, false); set_fake_ptr_latched(_compose_key, _compose_kv, pending, false);
} }
/** Called from [Keybard2.onUpdateSelection]. */
public void set_selection_state(boolean selection_state)
{
set_fake_ptr_latched(KeyboardData.Key.EMPTY,
KeyValue.getKeyByName("selection_mode"), selection_state, true);
}
public KeyValue modifyKey(KeyValue k, Pointers.Modifiers mods) public KeyValue modifyKey(KeyValue k, Pointers.Modifiers mods)
{ {
return KeyModifier.modify(k, mods); return KeyModifier.modify(k, mods);

View File

@@ -422,6 +422,8 @@ public final class KeyboardData
indication = i; indication = i;
} }
static final Key EMPTY = new Key(new KeyValue[9], null, 0, 1.f, 1.f, null);
/** Read a key value attribute that have a synonym. Having both synonyms /** Read a key value attribute that have a synonym. Having both synonyms
present at the same time is an error. present at the same time is an error.
Returns [null] if the attributes are not present. */ Returns [null] if the attributes are not present. */

View File

@@ -3,6 +3,7 @@ package juloo.keyboard2.prefs;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.res.Resources; import android.content.res.Resources;
import android.os.Build.VERSION;
import android.preference.CheckBoxPreference; import android.preference.CheckBoxPreference;
import android.preference.PreferenceCategory; import android.preference.PreferenceCategory;
import android.util.AttributeSet; import android.util.AttributeSet;
@@ -425,6 +426,7 @@ public class ExtraKeysPreference extends PreferenceCategory
setKey(pref_key_of_key_name(key_name)); setKey(pref_key_of_key_name(key_name));
setDefaultValue(default_checked); setDefaultValue(default_checked);
setTitle(title); setTitle(title);
if (VERSION.SDK_INT >= 26)
setSingleLineTitle(false); setSingleLineTitle(false);
} }

View File

@@ -74,7 +74,11 @@ def sync_metadata(value_dir, strings):
os.makedirs(meta_dir) os.makedirs(meta_dir)
txt_file = os.path.join(meta_dir, fname) txt_file = os.path.join(meta_dir, fname)
with open(txt_file, "w", encoding="utf-8") as out: with open(txt_file, "w", encoding="utf-8") as out:
out.write(string.text.removeprefix('"').removesuffix('"')) out.write(string.text
.replace("\\n", "\n")
.replace("\\'", "'")
.removeprefix('"')
.removesuffix('"'))
out.write("\n") out.write("\n")
sync_meta_file("title.txt", ("app_name_release", None)) sync_meta_file("title.txt", ("app_name_release", None))
sync_meta_file("short_description.txt", ("short_description", None)) sync_meta_file("short_description.txt", ("short_description", None))