onLongPress -> right click
This commit is contained in:
parent
5df90d4fa1
commit
7573793d6c
@ -28,7 +28,6 @@ class _RemotePageState extends State<RemotePage> {
|
|||||||
String _value = '';
|
String _value = '';
|
||||||
double _xOffset = 0;
|
double _xOffset = 0;
|
||||||
double _yOffset = 0;
|
double _yOffset = 0;
|
||||||
double _xOffset0 = 0;
|
|
||||||
double _yOffset0 = 0;
|
double _yOffset0 = 0;
|
||||||
double _scale = 1;
|
double _scale = 1;
|
||||||
bool _mouseTools = false;
|
bool _mouseTools = false;
|
||||||
@ -258,24 +257,17 @@ class _RemotePageState extends State<RemotePage> {
|
|||||||
: null,
|
: null,
|
||||||
body: FlutterEasyLoading(
|
body: FlutterEasyLoading(
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
|
onLongPress: () {
|
||||||
|
if (_drag || _scroll) return;
|
||||||
|
FFI.tap(true);
|
||||||
|
},
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (_drag || _scroll) return;
|
if (_drag || _scroll) return;
|
||||||
FFI.tap(_right);
|
FFI.tap(_right);
|
||||||
},
|
},
|
||||||
onLongPressStart: (_) {
|
|
||||||
if (_drag) {
|
|
||||||
// case: to show password on windows
|
|
||||||
FFI.sendMouse('down', 'left');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLongPressEnd: (_) {
|
|
||||||
if (_drag) {
|
|
||||||
FFI.sendMouse('up', 'left');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onScaleStart: (details) {
|
onScaleStart: (details) {
|
||||||
_scale = 1;
|
_scale = 1;
|
||||||
_xOffset = _xOffset0 = details.focalPoint.dx;
|
_xOffset = details.focalPoint.dx;
|
||||||
_yOffset = _yOffset0 = details.focalPoint.dy;
|
_yOffset = _yOffset0 = details.focalPoint.dy;
|
||||||
if (_drag) {
|
if (_drag) {
|
||||||
FFI.sendMouse('down', 'left');
|
FFI.sendMouse('down', 'left');
|
||||||
@ -304,6 +296,11 @@ class _RemotePageState extends State<RemotePage> {
|
|||||||
onScaleEnd: (details) {
|
onScaleEnd: (details) {
|
||||||
if (_drag) {
|
if (_drag) {
|
||||||
FFI.sendMouse('up', 'left');
|
FFI.sendMouse('up', 'left');
|
||||||
|
setState(() {
|
||||||
|
_drag = false;
|
||||||
|
_scroll = false;
|
||||||
|
_right = false;
|
||||||
|
});
|
||||||
} else if (_scroll) {
|
} else if (_scroll) {
|
||||||
var dy = (_yOffset - _yOffset0) / 10;
|
var dy = (_yOffset - _yOffset0) / 10;
|
||||||
if (dy.abs() > 0.1) {
|
if (dy.abs() > 0.1) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user