Skip to content

Commit

Permalink
Merge branch 'MAIN' into pr/770
Browse files Browse the repository at this point in the history
  • Loading branch information
Julow committed Oct 5, 2024
2 parents b1fec09 + 8a6dc34 commit ca9c07f
Show file tree
Hide file tree
Showing 54 changed files with 1,622 additions and 234 deletions.
Binary file modified assets/special_font.ttf
Binary file not shown.
11 changes: 8 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ plugins {
id 'com.android.application' version '8.1.1'
}

dependencies {
testImplementation "junit:junit:4.13.2"
}

android {
namespace 'juloo.keyboard2'
compileSdk 34
Expand All @@ -21,6 +25,10 @@ android {
res.srcDirs = ['res', 'build/generated-resources']
assets.srcDirs = ['assets']
}

test {
java.srcDirs = ['test']
}
}

signingConfigs {
Expand Down Expand Up @@ -84,9 +92,6 @@ android {
}
}

dependencies {
}

tasks.register('buildKeyboardFont') {
println "\nBuilding assets/special_font.ttf"
mkdir "$buildDir"
Expand Down
41 changes: 40 additions & 1 deletion doc/Possible-key-values.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Keys ending in `_placeholder` are normally hidden unless the Fn key is pressed.
`ole`, `ole_placeholder`,
`meteg`, `meteg_placeholder`

## Unexpected Keyboard specific
## Keyboard behavior keys
Value | Meaning
:--------------------- | :------
`config` | Gear icon; opens Unexpected Keyboard settings.
Expand Down Expand Up @@ -148,3 +148,42 @@ These keys are known to do nothing.
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.
1 change: 1 addition & 0 deletions res/values-cs/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ Tato aplikace neobsahuje žádné reklamy, nevyužívá připojení k síti a je
<string name="key_descr_home">Home</string>
<string name="key_descr_end">End</string>
<string name="key_descr_clipboard">Správce schránky</string>
<!-- <string name="key_descr_combining">Combining diacritic</string> -->
<string name="clipboard_history_heading">Nedávno kopírovaný text</string>
<string name="clipboard_pin_heading">Připnout</string>
<string name="clipboard_remove_confirm">Odebrat ze schránky?</string>
Expand Down
1 change: 1 addition & 0 deletions res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ Diese App enthält keine Werbung, benötigt keinen Netzwerkzugriff und ist quell
<string name="key_descr_home">Pos1</string>
<string name="key_descr_end">Ende</string>
<string name="key_descr_clipboard">Clipboard-Manager</string>
<!-- <string name="key_descr_combining">Combining diacritic</string> -->
<string name="clipboard_history_heading">Zuletzt kopierter Text</string>
<string name="clipboard_pin_heading">Angeheftet</string>
<string name="clipboard_remove_confirm">Aus der Zwischenablage entfernen?</string>
Expand Down
1 change: 1 addition & 0 deletions res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ La misma no contiene ningún anuncio/publicidad, no realiza peticiones de red y
<string name="key_descr_home">Inicio</string>
<string name="key_descr_end">Fin</string>
<string name="key_descr_clipboard">Arreglar portapapeles</string>
<!-- <string name="key_descr_combining">Combining diacritic</string> -->
<string name="clipboard_history_heading">Textos recién copiados</string>
<string name="clipboard_pin_heading">Pegado</string>
<string name="clipboard_remove_confirm">¿Sacar este portapapeles?</string>
Expand Down
1 change: 1 addition & 0 deletions res/values-fa/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ This application contains no ads, doesn't make any network requests and is Open
<!-- <string name="key_descr_home">Home</string> -->
<!-- <string name="key_descr_end">End</string> -->
<!-- <string name="key_descr_clipboard">Clipboard manager</string> -->
<!-- <string name="key_descr_combining">Combining diacritic</string> -->
<!-- <string name="clipboard_history_heading">Recently copied text</string> -->
<!-- <string name="clipboard_pin_heading">Pinned</string> -->
<!-- <string name="clipboard_remove_confirm">Remove this clipboard?</string> -->
Expand Down
1 change: 1 addition & 0 deletions res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ 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_end">Fin</string>
<string name="key_descr_clipboard">Presse-papiers</string>
<!-- <string name="key_descr_combining">Combining diacritic</string> -->
<string name="clipboard_history_heading">Texte récemment copié</string>
<string name="clipboard_pin_heading">Épinglé</string>
<string name="clipboard_remove_confirm">Supprimer ce presse-papiers ?</string>
Expand Down
1 change: 1 addition & 0 deletions res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ This application contains no ads, doesn't make any network requests and is Open
<!-- <string name="key_descr_home">Home</string> -->
<!-- <string name="key_descr_end">End</string> -->
<!-- <string name="key_descr_clipboard">Clipboard manager</string> -->
<!-- <string name="key_descr_combining">Combining diacritic</string> -->
<!-- <string name="clipboard_history_heading">Recently copied text</string> -->
<!-- <string name="clipboard_pin_heading">Pinned</string> -->
<!-- <string name="clipboard_remove_confirm">Remove this clipboard?</string> -->
Expand Down
1 change: 1 addition & 0 deletions res/values-ja/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ PCキーボードでの半角入力を再現しています。日本語入力、
<string name="key_descr_home">Home</string>
<string name="key_descr_end">End</string>
<string name="key_descr_clipboard">クリップボード</string>
<!-- <string name="key_descr_combining">Combining diacritic</string> -->
<string name="clipboard_history_heading">最近コピーしたテキスト</string>
<string name="clipboard_pin_heading">お気に入り</string>
<string name="clipboard_remove_confirm">クリップボードから削除しますか?</string>
Expand Down
1 change: 1 addition & 0 deletions res/values-ko/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
<string name="key_descr_home">홈</string>
<string name="key_descr_end">종료</string>
<string name="key_descr_clipboard">클립보드 관리자</string>
<!-- <string name="key_descr_combining">Combining diacritic</string> -->
<string name="clipboard_history_heading">최근에 복사한 텍스트</string>
<string name="clipboard_pin_heading">고정</string>
<string name="clipboard_remove_confirm">이 클립보드를 제거하시겠습니까?</string>
Expand Down
1 change: 1 addition & 0 deletions res/values-lv/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ Tagad lieliski piemērota izmantošanai ikdienā.
<string name="key_descr_home">Sākums</string>
<string name="key_descr_end">Beigas</string>
<string name="key_descr_clipboard">Starpliktuves pārvaldnieks</string>
<!-- <string name="key_descr_combining">Combining diacritic</string> -->
<string name="clipboard_history_heading">Nesen starpliktuvē ievietots teksts</string>
<string name="clipboard_pin_heading">Piesprausts</string>
<string name="clipboard_remove_confirm">Noņemt šo starpliktuves vienumu?</string>
Expand Down
1 change: 1 addition & 0 deletions res/values-pl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ Aplikacja nie zawiera reklam, nie żąda dostępu do internetu, a jej kod źród
<string name="key_descr_home">Home</string>
<string name="key_descr_end">End</string>
<string name="key_descr_clipboard">Zarządzanie schowkiem</string>
<!-- <string name="key_descr_combining">Combining diacritic</string> -->
<string name="clipboard_history_heading">Ostatnio skopiowane elementy</string>
<string name="clipboard_pin_heading">Przypięte</string>
<string name="clipboard_remove_confirm">Usunąć ten element ze schowka?</string>
Expand Down
1 change: 1 addition & 0 deletions res/values-pt/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ Este aplicativo não contém anúncios, não faz nenhuma solicitação de rede e
<string name="key_descr_home">Home</string>
<string name="key_descr_end">End</string>
<!-- <string name="key_descr_clipboard">Clipboard manager</string> -->
<!-- <string name="key_descr_combining">Combining diacritic</string> -->
<!-- <string name="clipboard_history_heading">Recently copied text</string> -->
<!-- <string name="clipboard_pin_heading">Pinned</string> -->
<!-- <string name="clipboard_remove_confirm">Remove this clipboard?</string> -->
Expand Down
1 change: 1 addition & 0 deletions res/values-ro/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ Această aplicație nu conține publicitate, nu folosește rețeaua deloc și e
<!-- <string name="key_descr_home">Home</string> -->
<!-- <string name="key_descr_end">End</string> -->
<!-- <string name="key_descr_clipboard">Clipboard manager</string> -->
<!-- <string name="key_descr_combining">Combining diacritic</string> -->
<!-- <string name="clipboard_history_heading">Recently copied text</string> -->
<!-- <string name="clipboard_pin_heading">Pinned</string> -->
<!-- <string name="clipboard_remove_confirm">Remove this clipboard?</string> -->
Expand Down
1 change: 1 addition & 0 deletions res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
<string name="key_descr_home">Home</string>
<string name="key_descr_end">End</string>
<string name="key_descr_clipboard">Менеджер буфера обмена</string>
<!-- <string name="key_descr_combining">Combining diacritic</string> -->
<string name="clipboard_history_heading">Недавно скопированный текст</string>
<string name="clipboard_pin_heading">Закреплено</string>
<string name="clipboard_remove_confirm">Удалить этот буфер обмена?</string>
Expand Down
1 change: 1 addition & 0 deletions res/values-tr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ Bu uygulama açık kaynaklıdır. Reklam içermez ve internete bağlanmaz."</str
<string name="key_descr_home">BAŞ(Sol yön tuşu)</string>
<string name="key_descr_end">SON(Sağ yön tuşu)</string>
<string name="key_descr_clipboard">Pano</string>
<!-- <string name="key_descr_combining">Combining diacritic</string> -->
<string name="clipboard_history_heading">Son kopyalanan metin</string>
<string name="clipboard_pin_heading">Sabitlendi</string>
<string name="clipboard_remove_confirm">Bu sabitlemeyi sil</string>
Expand Down
1 change: 1 addition & 0 deletions res/values-uk/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
<string name="key_descr_home">Home</string>
<string name="key_descr_end">End</string>
<string name="key_descr_clipboard">Менеджер буфера обміну</string>
<!-- <string name="key_descr_combining">Combining diacritic</string> -->
<string name="clipboard_history_heading">Нещодавно скопійований текст</string>
<string name="clipboard_pin_heading">Закріплено</string>
<string name="clipboard_remove_confirm">Видалити цей буфер обміну?</string>
Expand Down
1 change: 1 addition & 0 deletions res/values-vi/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ Bây giờ đã hoàn hảo cho việc sử dụng hàng ngày.
<!-- <string name="key_descr_home">Home</string> -->
<!-- <string name="key_descr_end">End</string> -->
<!-- <string name="key_descr_clipboard">Clipboard manager</string> -->
<!-- <string name="key_descr_combining">Combining diacritic</string> -->
<!-- <string name="clipboard_history_heading">Recently copied text</string> -->
<!-- <string name="clipboard_pin_heading">Pinned</string> -->
<!-- <string name="clipboard_remove_confirm">Remove this clipboard?</string> -->
Expand Down
1 change: 1 addition & 0 deletions res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
<string name="key_descr_home">Home</string>
<string name="key_descr_end">End</string>
<!-- <string name="key_descr_clipboard">Clipboard manager</string> -->
<!-- <string name="key_descr_combining">Combining diacritic</string> -->
<!-- <string name="clipboard_history_heading">Recently copied text</string> -->
<!-- <string name="clipboard_pin_heading">Pinned</string> -->
<!-- <string name="clipboard_remove_confirm">Remove this clipboard?</string> -->
Expand Down
1 change: 1 addition & 0 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ This application contains no ads, doesn't make any network requests and is Open
<string name="key_descr_home">Home</string>
<string name="key_descr_end">End</string>
<string name="key_descr_clipboard">Clipboard manager</string>
<string name="key_descr_combining">Combining diacritic</string>
<string name="clipboard_history_heading">Recently copied text</string>
<string name="clipboard_pin_heading">Pinned</string>
<string name="clipboard_remove_confirm">Remove this clipboard?</string>
Expand Down
9 changes: 6 additions & 3 deletions srcs/compose/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,12 @@ def strip_line(line):

# Parse from a json file containing a dictionary sequence → result string.
def parse_sequences_file_json(fname):
with open(fname, "r") as inp:
seqs = json.loads(strip_cstyle_comments(inp))
return list(seqs.items())
try:
with open(fname, "r") as inp:
seqs = json.loads(strip_cstyle_comments(inp))
return list(seqs.items())
except Exception as e:
print("Failed parsing '%s': %s" % (fname, str(e)), file=sys.stderr)

# Format of the sequences file is determined by its extension
def parse_sequences_file(fname, xkb_char_extra_names={}):
Expand Down
138 changes: 138 additions & 0 deletions srcs/compose/compose/cyrillic.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
{
"\"": {
"і": "ї"
},
",": {
"г": "ӻ",
"к": "ӄ",
"л": "ԓ",
"н": "ӈ",
"х": "ӽ"
},
".": {
"г": "ӷ",
"ж": "җ",
"й": "ҋ",
"к": "қ",
"м": "ӎ",
"н": "ӊ",
"і": "ї"
},
"а": {
"е": "ѣ",
"у": "ѡ",
"ъ": "ѣ",
"ы": "ѣ",
"ь": "",
"э": "ѣ",
"є": "ѣ",
"ꙑ": "ѣ"
},
"г": {
",": "ӻ",
".": "ӷ",
"й": "ғ",
"х": "ҁ",
"ј": "ғ"
},
"д": {
"е": "",
"ж": "џ",
"з": "",
"й": "",
"ј": ""
},
"е": {
"о": "ё"
},
"ж": {
".": "җ"
},
"з": {
"ф": "ҙ"
},
"и": {
"и": "ӣ",
"й": "ӣ",
"у": "ѵ",
"ј": "ӣ"
},
"й": {
".": "ҋ"
},
"к": {
",": "ӄ",
".": "қ",
"г": "ґ",
"с": "ѯ",
"х": "ҁ",
"ш": "ѯ"
},
"л": {
",": "ԓ",
"ь": "љ"
},
"м": {
".": "ӎ"
},
"н": {
",": "ӈ",
".": "ӊ",
"ь": "њ"
},
"о": {
"т": "ѿ",
"у": "ѹ"
},
"п": {
"с": "ѱ",
"ш": "ѱ"
},
"т": {
"й": "ћ",
"ф": "ѳ",
"ј": "ћ"
},
"у": {
"у": "ӯ",
"ъ": "ў"
},
"х": {
",": "ӽ",
"й": "ҳ",
"ь": "ҳ",
"ј": "ҳ"
},
"ш": {
"ч": "щ"
},
"ы": {
"у": "ѡ",
"ъ": ""
},
"ю": {
"а": "",
"е": "ѥ",
"м": "ѭ",
"н": "ѩ",
"э": "ѥ"
},
"я": {
"ь": ""
},
"і": {
"\"": "ї",
".": "ї",
"й": "ӣ",
"у": "ѵ",
"і": "ӣ",
"ј": "ӣ"
},
"ѡ": {
"т": "ѿ"
},
"ꙑ": {
"ь": "ы",
"у": "ѡ"
}
}
Loading

0 comments on commit ca9c07f

Please sign in to comment.