update mobile mouse scroll
This commit is contained in:
parent
3a66d52c2d
commit
cfd4fd492b
@ -691,11 +691,9 @@ class FFI {
|
|||||||
sendMouse('up', button);
|
sendMouse('up', button);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void scroll(double y) {
|
static void scroll(int y) {
|
||||||
var y2 = y.round();
|
|
||||||
if (y2 == 0) return;
|
|
||||||
setByName('send_mouse',
|
setByName('send_mouse',
|
||||||
json.encode(modify({'type': 'wheel', 'y': y2.toString()})));
|
json.encode(modify({'type': 'wheel', 'y': y.toString()})));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void reconnect() {
|
static void reconnect() {
|
||||||
|
@ -32,6 +32,7 @@ class _RemotePageState extends State<RemotePage> {
|
|||||||
double _bottom = 0;
|
double _bottom = 0;
|
||||||
String _value = '';
|
String _value = '';
|
||||||
double _scale = 1;
|
double _scale = 1;
|
||||||
|
double _mouseScrollIntegral = 0; // mouse scroll speed controller
|
||||||
|
|
||||||
var _more = true;
|
var _more = true;
|
||||||
var _fn = false;
|
var _fn = false;
|
||||||
@ -544,7 +545,14 @@ class _RemotePageState extends State<RemotePage> {
|
|||||||
onThreeFingerVerticalDragUpdate: FFI.ffiModel.isPeerAndroid
|
onThreeFingerVerticalDragUpdate: FFI.ffiModel.isPeerAndroid
|
||||||
? null
|
? null
|
||||||
: (d) {
|
: (d) {
|
||||||
FFI.scroll(d.delta.dy / 2);
|
_mouseScrollIntegral += d.delta.dy / 4;
|
||||||
|
if (_mouseScrollIntegral > 1) {
|
||||||
|
FFI.scroll(1);
|
||||||
|
_mouseScrollIntegral = 0;
|
||||||
|
} else if (_mouseScrollIntegral < -1) {
|
||||||
|
FFI.scroll(-1);
|
||||||
|
_mouseScrollIntegral = 0;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user