Skip to content

Commit a4b5a5b

Browse files
🔄 Sync from private repository - 2026-04-02 04:34:15
1 parent ae2e164 commit a4b5a5b

2 files changed

Lines changed: 19 additions & 10 deletions

File tree

TrollScript-Private

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Subproject commit cbf7b00b22e7f8ec202ce39ad89af304c1ad2723
1+
Subproject commit 0eceb4cf6f149ac421ee7a2e65c4299dcb154502

templates/API/Input.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,23 +111,23 @@ input.tap(s.width / 2, s.height / 2);
111111

112112
#### `input.touchDown(x, y, fingerID?, displayId?)`
113113

114-
模拟触摸按下。兼容 AutoGo 风格签名,但当前仅支持 `fingerID = 0``displayId = 0`**返回:** `boolean`
114+
模拟触摸按下。兼容常见脚本签名,但当前仅支持 `fingerID = 0``displayId = 0`**返回:** `boolean`
115115

116116
```javascript
117117
input.touchDown(500, 600, 0, 0);
118118
```
119119

120120
#### `input.touchMove(x, y, fingerID?, displayId?)`
121121

122-
模拟触摸移动。兼容 AutoGo 风格签名,但当前仅支持 `fingerID = 0``displayId = 0`**返回:** `boolean`
122+
模拟触摸移动。兼容常见脚本签名,但当前仅支持 `fingerID = 0``displayId = 0`**返回:** `boolean`
123123

124124
```javascript
125125
input.touchMove(550, 650, 0, 0);
126126
```
127127

128128
#### `input.touchUp(x, y, fingerID?, displayId?)`
129129

130-
模拟触摸抬起。兼容 AutoGo 风格签名,但当前仅支持 `fingerID = 0``displayId = 0`**返回:** `boolean`
130+
模拟触摸抬起。兼容常见脚本签名,但当前仅支持 `fingerID = 0``displayId = 0`**返回:** `boolean`
131131

132132
```javascript
133133
input.touchUp(550, 650, 0, 0);
@@ -203,7 +203,7 @@ input.drag(200, 300, 200, 500, 0.5);
203203
204204
#### `input.swipe2(fromX, fromY, toX, toY, duration?)`
205205

206-
AutoGo 兼容别名。当前实现仍然复用 `swipe` 的线性轨迹,不是贝塞尔曲线。**返回:** `boolean`
206+
兼容别名。当前实现仍然复用 `swipe` 的线性轨迹,不是贝塞尔曲线。**返回:** `boolean`
207207

208208
```javascript
209209
input.swipe2(300, 800, 300, 200, 0.5);
@@ -314,19 +314,24 @@ input.pressButtons(["volumeUp", "volumeDown"]);
314314

315315
> 内部实现:按序发送所有 key down 事件 → 保持 150ms → 反序发送所有 key up 事件。
316316
317-
### AutoGo 风格系统动作
317+
### 系统动作
318+
已恢复映射:
319+
`home``recents` 以及 `keyAction()` 中的部分 keycode 采用文档 [ios-hid-input-analysis.md](/Users/dompling/Desktop/GIT/TrollScript/docs/ios-hid-input-analysis.md) 中已恢复出的 iOS 映射。
320+
321+
平台扩展:
322+
`back``notifications``quickSettings``camera``powerDialog` 属于当前工程的 iOS 平台扩展动作,不代表已恢复出的参考实现一定使用同一路径。
318323

319324
#### `input.home(displayId?)`
320325

321-
使用 iOS 上滑手势近似返回主屏。当前仅支持 `displayId = 0`**返回:** `boolean`
326+
当前实现使用 Home 键仿真方式返回主屏。当前仅支持 `displayId = 0`**返回:** `boolean`
322327

323328
#### `input.back(displayId?)`
324329

325330
使用 iOS 左缘返回手势近似执行返回动作。当前仅支持 `displayId = 0`**返回:** `boolean`
326331

327332
#### `input.recents(displayId?)`
328333

329-
使用 iOS 上滑并停留手势近似打开多任务界面。当前仅支持 `displayId = 0`**返回:** `boolean`
334+
当前实现使用「双击 Home」近似打开多任务界面。当前仅支持 `displayId = 0`**返回:** `boolean`
330335

331336
#### `input.notifications()`
332337

@@ -346,14 +351,17 @@ input.pressButtons(["volumeUp", "volumeDown"]);
346351

347352
#### `input.keyAction(code, displayId?)`
348353

349-
按 AutoGo/Android 风格 keycode 执行对应动作。当前只支持部分常见按键,且仅支持 `displayId = 0`**返回:** `boolean | object`
354+
按兼容 keycode 执行对应动作。当前只支持部分常见按键,且仅支持 `displayId = 0`**返回:** `boolean | object`
350355

351356
常用常量:
352357

353358
```javascript
354359
input.KEYCODE_HOME
355360
input.KEYCODE_BACK
361+
input.KEYCODE_SEARCH
356362
input.KEYCODE_ENTER
363+
input.KEYCODE_ESCAPE
364+
input.KEYCODE_FORWARD_DEL
357365
input.KEYCODE_VOLUME_UP
358366
input.KEYCODE_VOLUME_DOWN
359367
input.KEYCODE_NOTIFICATION
@@ -420,7 +428,8 @@ console.log("开始录制,请在屏幕上操作...");
420428
| 位移 < 10pt 且时间 < 300ms | `input.tap(x, y)` |
421429
| 位移 < 10pt 且时间 >= 500ms | `input.longPress(x, y, duration)` |
422430
| 位移 >= 10pt | `input.swipe(fromX, fromY, toX, toY, duration)` |
423-
| 多指/复杂轨迹/长时轨迹 | `input.touchDown/move/up(...)` 原始回放 |
431+
| 单指复杂轨迹/长时轨迹 | `input.touchDown/move/up(...)` 原始回放 |
432+
| 多指轨迹 | 仅返回 warning,脚本中写入省略注释,不自动生成多指回放 |
424433
| 手势间隔 > 50ms | 插入 `util.sleep(interval)` |
425434

426435
```javascript

0 commit comments

Comments
 (0)