Skip to content

Commit 0d89c9e

Browse files
authored
Merge pull request #51 from ensan-hcl/develop_v1.2
[Release] Version 1.2
2 parents 3747b30 + 64a202a commit 0d89c9e

11 files changed

+238
-63
lines changed

Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.3
1+
// swift-tools-version:5.7
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription

json/howToMake.md

+8-3
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
```json
4646
"design": {
4747
"label": {
48+
"type": "text",
4849
"text": "@#/&_"
4950
},
5051
"color": "normal"
@@ -53,10 +54,11 @@
5354

5455
`"label"`はキーに表示されるラベルです。ラベルに指定できる値は次の通りです。
5556

56-
| 項目 | 説明 |
57+
| type | 説明 |
5758
| ----------------- | ------------------------------------------------------------ |
58-
| text: str | 指定した文字をラベルとして表示します。 |
59-
| system_image: str | 指定した画像をラベルとして表示します。指定できる値は以下の通りです。<br />この画像はSFSymbolsから取得されます。 |
59+
| text | `"text"`に指定した文字をラベルとして表示します。 |
60+
| main_and_sub | `"main"`に指定した1文字を1行目に大きめに、`"sub"`に指定した文字列を2行目に小さめに表示します。 |
61+
| system_image | `"system_image"`に指定した画像をラベルとして表示します。指定できる値は以下の通りです。<br />この画像はSFSymbolsから取得されます。 |
6062

6163
<img src="../resource/symbols.png" style="zoom:15%;" />
6264

@@ -102,6 +104,7 @@ azooKeyでは`"input"`の他にいくつかの動作を行うことができま
102104
| toggle_tab_bar | なし | タブバーの表示をtoggleします。 |
103105
| toggle_caps_lock_state | なし | caps lockをtoggleします。 |
104106
| dismiss_keyboard | なし | キーボードを閉じます。 |
107+
| paste | なし | コピーしている文字列をペーストします。フルアクセスがない場合動作しません。 |
105108
| launch_application | scheme_type: str<br />target: str | scheme_typeで指定されたアプリケーションをscheme://(target)として開きます。scheme_typeには`"azooKey"``"shortcuts"`のみを指定できます。 |
106109

107110
続く`"longpress_actions"`はほぼ`"press_actions"`と同じです。
@@ -128,6 +131,8 @@ azooKeyでは`"input"`の他にいくつかの動作を行うことができま
128131
| qwerty_english[^2] | ローマ字入力の英語タブ |
129132
| qwerty_number[^2] | ローマ字入力の数字タブ |
130133
| qwerty_symbols[^2] | ローマ字入力の記号タブ |
134+
| emoji_tab | 絵文字タブ |
135+
| clipboard_history_tab | クリップボードの履歴タブ(フルアクセスが必要です) |
131136
| last_tab | このタブの前のタブ<br />もしも履歴がない場合、現在のタブの指定になります |
132137

133138
### バリエーション

python/howToMake.md

+4
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ design = KeyDesign(
4646
| オブジェクト | 初期化の引数 | 説明 |
4747
| ---------------- | --------------- | ------------------------------------------------------------ |
4848
| TextLabel | text: str | 指定した文字をラベルとして表示します。 |
49+
| MainAndSubLabel | main: str, sub: str | `main`に指定した1文字を1行目に大きめに、`sub`に指定した文字を2行目に小さめに表示します。 |
4950
| SystemImageLabel | identifier: str | 指定した名前の画像をラベルとして表示します。指定できる値は以下の通りです。<br />この画像はSFSymbolsから取得されます。 |
5051

5152
<img src="../resource/symbols.png" style="zoom:15%;" />
@@ -91,6 +92,7 @@ azooKeyでは`InputAction`の他にいくつかの動作を行うことができ
9192
| ToggleTabBarAction | なし | タブバーの表示をtoggleします。 |
9293
| ToggleCapsLockStateAction | なし | caps lockをtoggleします。 |
9394
| DismissKeyboardAction | なし | キーボードを閉じます。 |
95+
| PasteKeyboardAction | なし | コピーしている文字列をペーストします。フルアクセスがない場合動作しません。 |
9496
| LaunchApplicationAction | scheme_type: Literal['azooKey', 'shortcuts']<br />target: str | scheme_typeで指定されたアプリケーションをscheme://(target)として開きます。scheme_typeには`"azooKey"``"shortcuts"`のみを指定できます。 |
9597

9698
続く引数の`longpress_actions``LongpressAction`というオブジェクトで、ほぼ`press_actions`と同じです。
@@ -119,6 +121,8 @@ class LongpressAction(object):
119121
| qwerty_english[^2] | ローマ字入力の英語タブ |
120122
| qwerty_number[^2] | ローマ字入力の数字タブ |
121123
| qwerty_symbols[^2] | ローマ字入力の記号タブ |
124+
| emoji_tab | 絵文字タブ |
125+
| clipboard_history_tab | クリップボードの履歴タブ(フルアクセスが必要です) |
122126
| last_tab | このタブの前のタブ<br />もしも履歴がない場合、現在のタブの指定になります |
123127

124128
### バリエーション

python/source/actions.py

+5
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,11 @@ class DismissKeyboardAction(metaclass=ActionMeta):
213213
"""
214214
type = "dismiss_keyboard"
215215

216+
class PasteAction(metaclass=ActionMeta):
217+
"""
218+
ペーストを実行するアクション
219+
"""
220+
type = "paste"
216221

217222
class LongpressAction(object):
218223
def __init__(self, start: list[Action] = [], repeat: list[Action] = []):

python/source/design.py

+6
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ class SystemImageLabel(KeyLabel):
2323
def __init__(self, identifier: str):
2424
self.system_image = identifier
2525

26+
class MainAndSubLabel(KeyLabel):
27+
def __init__(self, main: str, sub: str):
28+
self.type = "main_and_sub"
29+
self.main = main
30+
self.sub = sub
31+
2632

2733
class KeyDesign:
2834
def __init__(self, label: KeyLabel, color: KeyColor):

python/test/test_actions.py

+6
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,12 @@ def test_NoArgumentsAction(self):
168168
}
169169
self.assertEqual(expected_json, actual)
170170

171+
actual = to_json(PasteAction())
172+
expected_json = {
173+
"type": "paste",
174+
}
175+
self.assertEqual(expected_json, actual)
176+
171177
def test_LongpressAction(self):
172178
"""test method for LongpressAction
173179
"""

python/test/test_design.py

+11
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,17 @@ def test_SystemImageLabel(self):
4343
}
4444
self.assertEqual(expected_json, to_json(label))
4545

46+
def test_MainAndSubLabel(self):
47+
"""test method for SystemImageLabel
48+
"""
49+
label = MainAndSubLabel(main="A", sub="BC")
50+
expected_json = {
51+
"type": "main_and_sub",
52+
"main": "A",
53+
"sub": "BC"
54+
}
55+
self.assertEqual(expected_json, to_json(label))
56+
4657
def test_KeyDesign(self):
4758
"""test method for KeyDesign
4859
"""

swift/howToMake.md

+4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ design: .init(label: .text("@#/&_"), color: .normal)
3838
| 項目 | 説明 |
3939
| -------------------- | ------------------------------------------------------------ |
4040
| .text(String) | 指定した文字をラベルとして表示します。 |
41+
| .mainAndSub(String, String) | 1つ目に指定した1文字を1行目に大きめに、2つ目に指定した文字を2行目に小さめに表示します。 |
4142
| .systemImage(String) | 指定した名前の画像をラベルとして表示します。指定できる値は以下の通りです。<br />この画像はSFSymbolsから取得されます。 |
4243

4344
<img src="../resource/symbols.png" style="zoom:15%;" />
@@ -83,6 +84,7 @@ azooKeyでは`input`の他にいくつかの動作を行うことができます
8384
| .toggleTabBar | なし | タブバーの表示をtoggleします。 |
8485
| .toggleCapsLockState | なし | caps lockをtoggleします。 |
8586
| .dismissKeyboard | なし | キーボードを閉じます。 |
87+
| .paste | なし | コピーしている文字列をペーストします。フルアクセスがない場合動作しません。 |
8688
| .launchApplication | LaunchItem | 引数で指定されたアプリケーションを開きます。 |
8789

8890
続く引数の`longpress_actions``CodableLongpressActionData`型の値です。定義は以下の通りで、`start``repeat`にそれぞれ行うべき動作を指定します。
@@ -135,6 +137,8 @@ enum CodableTabData{
135137
| .qwerty_english[^2] | ローマ字入力の英語タブ |
136138
| .qwerty_number[^2] | ローマ字入力の数字タブ |
137139
| .qwerty_symbols[^2] | ローマ字入力の記号タブ |
140+
| .emoji_tab | 絵文字タブ |
141+
| .clipboard_history_tab | クリップボードの履歴タブ(フルアクセスが必要です) |
138142
| .last_tab | このタブの前のタブ<br />もしも履歴がない場合、現在のタブの指定になります |
139143

140144
### ScanItem

0 commit comments

Comments
 (0)