feat(sender): 串流窗口补齐键盘/右键/滚轮与双向剪贴板同步
- video_window 处理右/中键(WM_RBUTTON/MBUTTON)与滚轮(WM_MOUSEWHEEL), 并通过 ttstd/video 的 mouse / wheel 方法通道交给 Dart - 键盘走 WM_KEYDOWN/UP 报 Windows 虚拟键码,Dart 侧映射成 Android keycode; Esc 仍保留为关窗,Alt 组合键旁路转发不吞掉 - 右键→返回、中键→多任务(buttons 位 bit1/bit2),滚轮按「deltaY 正=向下滚」取反 - 本机剪贴板每 700ms 轮询比较后下发 msg_type=4,被控端上行内容写入本机剪贴板; 两端都记住最近一次同步的文本,避免来回回送 - 控制栏「发送剪贴板」改为读取本机剪贴板实时内容(原先发的是固定占位字符串)
This commit is contained in:
1 parent
5f9fe88e37
commit
85e53f64ca
6 files changed
+345
-2
No files matched your search
@@ -37,6 +37,15 @@ class SenderBridge {
|
||||
/// x/y 是**画面像素坐标**(编码分辨率),由被控端换算成真实屏幕坐标。
|
||||
void Function(int action, int x, int y)? onVideoPointer;
|
||||
|
||||
/// 串流窗口里的右键/中键:(button, action, x, y),button 1=右键 2=中键。
|
||||
void Function(int button, int action, int x, int y)? onVideoMouseButton;
|
||||
|
||||
/// 串流窗口里的滚轮:(deltaX, deltaY),正数=向上/向右。
|
||||
void Function(int deltaX, int deltaY)? onVideoWheel;
|
||||
|
||||
/// 串流窗口里的键盘:(action, vk, modifiers),vk 是 Windows 虚拟键码。
|
||||
void Function(int action, int vk, int modifiers)? onVideoKey;
|
||||
|
||||
/// 取一条被控端上行的控制事件(投屏应答 / 剪贴板),没有则返回 null。
|
||||
///
|
||||
/// 事件形如 `{"type":8,"action":2,"text":""}`,`type` 是 msgType。
|
||||
@@ -54,6 +63,29 @@ class SenderBridge {
|
||||
final y = (args['y'] as num?)?.toInt();
|
||||
if (action == null || x == null || y == null) return;
|
||||
onVideoPointer?.call(action, x, y);
|
||||
case 'mouse':
|
||||
final args = call.arguments;
|
||||
if (args is! Map) return;
|
||||
final button = (args['button'] as num?)?.toInt();
|
||||
final action = (args['action'] as num?)?.toInt();
|
||||
final x = (args['x'] as num?)?.toInt();
|
||||
final y = (args['y'] as num?)?.toInt();
|
||||
if (button == null || action == null || x == null || y == null) return;
|
||||
onVideoMouseButton?.call(button, action, x, y);
|
||||
case 'wheel':
|
||||
final args = call.arguments;
|
||||
if (args is! Map) return;
|
||||
onVideoWheel?.call(
|
||||
(args['deltaX'] as num?)?.toInt() ?? 0,
|
||||
(args['deltaY'] as num?)?.toInt() ?? 0,
|
||||
);
|
||||
case 'key':
|
||||
final args = call.arguments;
|
||||
if (args is! Map) return;
|
||||
final action = (args['action'] as num?)?.toInt();
|
||||
final vk = (args['vk'] as num?)?.toInt();
|
||||
if (action == null || vk == null) return;
|
||||
onVideoKey?.call(action, vk, (args['modifiers'] as num?)?.toInt() ?? 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user