ms-vite-plugin 1.2.6 → 1.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/api/action.md +35 -0
- package/docs/apicn/action.md +35 -0
- package/docs/apipython/action.md +34 -0
- package/package.json +1 -1
package/docs/api/action.md
CHANGED
|
@@ -533,6 +533,41 @@ for (let i = 0; i < 5; i++) {
|
|
|
533
533
|
}
|
|
534
534
|
```
|
|
535
535
|
|
|
536
|
+
### sendKey - 发送键盘组合键
|
|
537
|
+
|
|
538
|
+
发送键盘组合键。Action 模块最终发送标准 USB HID Keyboard/Keypad usage。
|
|
539
|
+
|
|
540
|
+
参数可以直接传标准 usage 数字,也可以传单个 ASCII 字符、按键名称字符串,或现有 `hidKey` 常量;`hidKey` 常量会按兼容规则转换为标准 usage。
|
|
541
|
+
|
|
542
|
+
```typescript
|
|
543
|
+
function sendKey(key: Array<number | string>): boolean;
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
**参数说明:**
|
|
547
|
+
|
|
548
|
+
| 参数名 | 类型 | 是否必填 | 默认值 | 描述 |
|
|
549
|
+
| ------ | ---------------------- | -------- | ------ | -------------------------------------------------------------------- |
|
|
550
|
+
| `key` | Array<number \| string> | 是 | - | 要发送的按键数组;数字表示标准 USB HID usage,字符串表示按键名或字符 |
|
|
551
|
+
|
|
552
|
+
**返回值:**
|
|
553
|
+
|
|
554
|
+
| 类型 | 描述 |
|
|
555
|
+
| --------- | ------------ |
|
|
556
|
+
| `boolean` | 发送是否成功 |
|
|
557
|
+
|
|
558
|
+
**示例:**
|
|
559
|
+
|
|
560
|
+
```typescript
|
|
561
|
+
// 发送 Command+C。字符串名称会转换为标准 USB HID usage。
|
|
562
|
+
action.sendKey(["COMMAND", "c"]);
|
|
563
|
+
|
|
564
|
+
// 也可以直接传标准 USB HID usage:0xE3 = Left GUI/Command,0x06 = C。
|
|
565
|
+
action.sendKey([0xe3, 0x06]);
|
|
566
|
+
|
|
567
|
+
// 兼容现有 hidKey 常量,会先转换为标准 USB HID usage。
|
|
568
|
+
action.sendKey([hidKey.COMMAND, "v"]);
|
|
569
|
+
```
|
|
570
|
+
|
|
536
571
|
## W3C Actions
|
|
537
572
|
|
|
538
573
|
### w3cActions - 执行 W3C Actions JSON
|
package/docs/apicn/action.md
CHANGED
|
@@ -527,6 +527,41 @@ for (let i = 0; i < 5; i++) {
|
|
|
527
527
|
}
|
|
528
528
|
```
|
|
529
529
|
|
|
530
|
+
### 发送按键 - 发送键盘组合键
|
|
531
|
+
|
|
532
|
+
发送键盘组合键。动作模块最终发送标准 USB HID Keyboard/Keypad usage。
|
|
533
|
+
|
|
534
|
+
参数可以直接传标准 usage 数字,也可以传单个 ASCII 字符、按键名称字符串,或现有 `hidKey` 常量;`hidKey` 常量会按兼容规则转换为标准 usage。
|
|
535
|
+
|
|
536
|
+
```typescript
|
|
537
|
+
function 发送按键(按键: 数组<数字 | 字符串>): 布尔值;
|
|
538
|
+
```
|
|
539
|
+
|
|
540
|
+
**参数说明:**
|
|
541
|
+
|
|
542
|
+
| 参数名 | 类型 | 是否必填 | 默认值 | 描述 |
|
|
543
|
+
| ------ | ---------------- | -------- | ------ | -------------------------------------------------------------------- |
|
|
544
|
+
| `按键` | 数组<数字 \| 字符串> | 是 | - | 要发送的按键数组;数字表示标准 USB HID usage,字符串表示按键名或字符 |
|
|
545
|
+
|
|
546
|
+
**返回值:**
|
|
547
|
+
|
|
548
|
+
| 类型 | 描述 |
|
|
549
|
+
| -------- | ------------ |
|
|
550
|
+
| `布尔值` | 发送是否成功 |
|
|
551
|
+
|
|
552
|
+
**示例:**
|
|
553
|
+
|
|
554
|
+
```typescript
|
|
555
|
+
// 发送 Command+C。字符串名称会转换为标准 USB HID usage。
|
|
556
|
+
$动作.发送按键(["COMMAND", "c"]);
|
|
557
|
+
|
|
558
|
+
// 也可以直接传标准 USB HID usage:0xE3 = Left GUI/Command,0x06 = C。
|
|
559
|
+
$动作.发送按键([0xe3, 0x06]);
|
|
560
|
+
|
|
561
|
+
// 兼容现有 hidKey 常量,会先转换为标准 USB HID usage。
|
|
562
|
+
$动作.发送按键([hidKey.COMMAND, "v"]);
|
|
563
|
+
```
|
|
564
|
+
|
|
530
565
|
## W3C Actions
|
|
531
566
|
|
|
532
567
|
### 执行W3C动作 - 执行 W3C Actions JSON
|
package/docs/apipython/action.md
CHANGED
|
@@ -503,6 +503,40 @@ for i in range(5):
|
|
|
503
503
|
action.pressButton("volumeup")
|
|
504
504
|
```
|
|
505
505
|
|
|
506
|
+
### sendKey - 发送键盘组合键
|
|
507
|
+
|
|
508
|
+
发送键盘组合键。Action 模块最终发送标准 USB HID Keyboard/Keypad usage。
|
|
509
|
+
|
|
510
|
+
参数可以直接传标准 usage 数字,也可以传单个 ASCII 字符、按键名称字符串,或现有 `hidKey` 常量;`hidKey` 常量会按兼容规则转换为标准 usage。
|
|
511
|
+
|
|
512
|
+
```python
|
|
513
|
+
def sendKey(key: List[Union[int, str]]) -> bool
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
**参数说明:**
|
|
517
|
+
|
|
518
|
+
| 参数名 | 类型 | 是否必填 | 默认值 | 描述 |
|
|
519
|
+
| ------ | --------------------- | -------- | ------ | -------------------------------------------------------------------- |
|
|
520
|
+
| `key` | List[Union[int, str]] | 是 | - | 要发送的按键列表;数字表示标准 USB HID usage,字符串表示按键名或字符 |
|
|
521
|
+
|
|
522
|
+
**返回值:**
|
|
523
|
+
|
|
524
|
+
| 类型 | 描述 |
|
|
525
|
+
| ------ | ------------ |
|
|
526
|
+
| `bool` | 发送是否成功 |
|
|
527
|
+
|
|
528
|
+
**示例:**
|
|
529
|
+
|
|
530
|
+
```python
|
|
531
|
+
from kuaijs import action
|
|
532
|
+
|
|
533
|
+
# 发送 Command+C。字符串名称会转换为标准 USB HID usage。
|
|
534
|
+
action.sendKey(["COMMAND", "c"])
|
|
535
|
+
|
|
536
|
+
# 也可以直接传标准 USB HID usage:0xE3 = Left GUI/Command,0x06 = C。
|
|
537
|
+
action.sendKey([0xE3, 0x06])
|
|
538
|
+
```
|
|
539
|
+
|
|
506
540
|
## W3C Actions
|
|
507
541
|
|
|
508
542
|
### w3cActions - 执行 W3C Actions JSON
|