feat(sender): 串流窗口支持点击与拖拽控制

- video_window 增加 InputHandler 回调,WM_LBUTTONDOWN/MOUSEMOVE/LBUTTONUP/CAPTURECHANGED
  映射为 0/2/1/3,移动事件按 60Hz 限流
- Paint 记录帧尺寸与实际绘制矩形,ClientToFrame 换算到画面像素并过滤黑边
- video_texture 通过方法通道转发 pointer 事件到 Dart,析构时清空回调
- bridge.dart 新增 onVideoPointer,main.dart 以 msg_type=0 触摸帧下发(压力 1000/0)
This commit is contained in:
tongtong committed 2026-11-27 15:06:46 +08:00
1 parent 03a5853da7
commit a102d10089
5 files changed
+166 -2

No files matched your search

+17 -2
View File
@@ -30,9 +30,24 @@ class SenderBridge {
/// 用户关掉独立串流窗口(点关闭按钮 / 按 ESC)时触发,用于停止投屏。
void Function()? onVideoWindowClosed;
/// 用户在串流窗口里点击/拖拽画面时触发:(action, x, y)。
///
/// action 与协议 TouchEvent.action 一致(0=按下 1=抬起 2=移动 3=取消),
/// x/y 是**画面像素坐标**(编码分辨率),由被控端换算成真实屏幕坐标。
void Function(int action, int x, int y)? onVideoPointer;
Future<void> _handleVideoCall(MethodCall call) async {
if (call.method == 'windowClosed') {
onVideoWindowClosed?.call();
switch (call.method) {
case 'windowClosed':
onVideoWindowClosed?.call();
case 'pointer':
final args = call.arguments;
if (args is! Map) return;
final action = (args['action'] as num?)?.toInt();
final x = (args['x'] as num?)?.toInt();
final y = (args['y'] as num?)?.toInt();
if (action == null || x == null || y == null) return;
onVideoPointer?.call(action, x, y);
}
}