mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-13 11:35:56 +00:00
listen flutter key event when there's no input monitor permission
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_hbb/models/state_model.dart';
|
||||
|
||||
import '../../common.dart';
|
||||
import '../../models/input_model.dart';
|
||||
|
||||
class RawKeyFocusScope extends StatelessWidget {
|
||||
@@ -20,13 +18,6 @@ class RawKeyFocusScope extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final FocusOnKeyCallback? onKey;
|
||||
if (isAndroid) {
|
||||
onKey = inputModel.handleRawKeyEvent;
|
||||
} else {
|
||||
onKey = stateGlobal.grabKeyboard ? inputModel.handleRawKeyEvent : null;
|
||||
}
|
||||
|
||||
return FocusScope(
|
||||
autofocus: true,
|
||||
child: Focus(
|
||||
@@ -34,7 +25,7 @@ class RawKeyFocusScope extends StatelessWidget {
|
||||
canRequestFocus: true,
|
||||
focusNode: focusNode,
|
||||
onFocusChange: onFocusChange,
|
||||
onKey: onKey,
|
||||
onKey: inputModel.handleRawKeyEvent,
|
||||
child: child));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user