mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
Feat/android more actions (#8496)
* feat: android volume and power actions Signed-off-by: fufesou <linlong1266@gmail.com> * Add translations and refact action menus Signed-off-by: fufesou <linlong1266@gmail.com> * Remove divider Signed-off-by: fufesou <linlong1266@gmail.com> * fix: recover deleted translations Signed-off-by: fufesou <linlong1266@gmail.com> --------- Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
@@ -1152,4 +1152,27 @@ class InputModel {
|
||||
platformFFI.stopDesktopWebListener();
|
||||
}
|
||||
}
|
||||
|
||||
void onMobileBack() => tap(MouseButtons.right);
|
||||
void onMobileHome() => tap(MouseButtons.wheel);
|
||||
Future<void> onMobileApps() async {
|
||||
sendMouse('down', MouseButtons.wheel);
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
sendMouse('up', MouseButtons.wheel);
|
||||
}
|
||||
|
||||
// Simulate a key press event.
|
||||
// `usbHidUsage` is the USB HID usage code of the key.
|
||||
Future<void> tapHidKey(int usbHidUsage) async {
|
||||
inputRawKey(kKeyFlutterKey, usbHidUsage, 0, true);
|
||||
await Future.delayed(Duration(milliseconds: 100));
|
||||
inputRawKey(kKeyFlutterKey, usbHidUsage, 0, false);
|
||||
}
|
||||
|
||||
Future<void> onMobileVolumeUp() async =>
|
||||
await tapHidKey(PhysicalKeyboardKey.audioVolumeUp.usbHidUsage);
|
||||
Future<void> onMobileVolumeDown() async =>
|
||||
await tapHidKey(PhysicalKeyboardKey.audioVolumeDown.usbHidUsage);
|
||||
Future<void> onMobilePower() async =>
|
||||
await tapHidKey(PhysicalKeyboardKey.power.usbHidUsage);
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ class FfiModel with ChangeNotifier {
|
||||
if (desktopType == DesktopType.remote) {
|
||||
KeyboardEnabledState.find(id).value = _permissions['keyboard'] != false;
|
||||
}
|
||||
debugPrint('$_permissions');
|
||||
debugPrint('updatePermission: $_permissions');
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user