diff --git a/flutter_hbb/lib/remote_page.dart b/flutter_hbb/lib/remote_page.dart index 4d5ec92ab..15f1d4d3a 100644 --- a/flutter_hbb/lib/remote_page.dart +++ b/flutter_hbb/lib/remote_page.dart @@ -156,6 +156,7 @@ class _RemotePageState extends State { void openKeyboard() { // destroy first, so that our _value trick can work _value = initText; + resetMouse(); setState(() => _showKeyboard = false); _timer?.cancel(); _timer = Timer(Duration(milliseconds: 30), () { @@ -171,6 +172,13 @@ class _RemotePageState extends State { }); } + void resetMouse() { + _drag = false; + _scroll = false; + _right = false; + _mouseTools = false; + } + @override Widget build(BuildContext context) { final pi = Provider.of(context).pi; @@ -300,12 +308,7 @@ class _RemotePageState extends State { onScaleEnd: (details) { if (_drag) { FFI.sendMouse('up', 'left'); - setState(() { - _drag = false; - _scroll = false; - _right = false; - _mouseTools = false; - }); + setState(resetMouse); } else if (_scroll) { var dy = (_yOffset - _yOffset0) / 10; if (dy.abs() > 0.1) {