fix mobile physical mouse wheel scroll

This commit is contained in:
csf 2022-09-26 16:52:23 +08:00
parent 0589f5ae9a
commit 536f25f33c

View File

@ -325,17 +325,13 @@ class _RemotePageState extends State<RemotePage> {
}, },
onPointerSignal: (e) { onPointerSignal: (e) {
if (e is PointerScrollEvent) { if (e is PointerScrollEvent) {
var dx = e.scrollDelta.dx; var dy = 0;
var dy = e.scrollDelta.dy; if (e.scrollDelta.dy > 0) {
if (dx > 0)
dx = -1;
else if (dx < 0) dx = 1;
if (dy > 0)
dy = -1; dy = -1;
else if (dy < 0) dy = 1; } else if (e.scrollDelta.dy < 0) {
bind.sessionSendMouse( dy = 1;
id: widget.id, }
msg: '{"type": "wheel", "x": "$dx", "y": "$dy"}'); gFFI.scroll(dy);
} }
}, },
child: MouseRegion( child: MouseRegion(