mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
refactor: keyboard of client
This commit is contained in:
@@ -1189,11 +1189,12 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
|
||||
MenuEntryRadioOption(text: translate('Legacy mode'), value: 'legacy'),
|
||||
MenuEntryRadioOption(text: translate('Map mode'), value: 'map'),
|
||||
],
|
||||
curOptionGetter: () async =>
|
||||
await bind.sessionGetKeyboardName(id: widget.id),
|
||||
curOptionGetter: () async {
|
||||
return await bind.sessionGetKeyboardMode(id: widget.id) ?? "legacy";
|
||||
},
|
||||
optionSetter: (String oldValue, String newValue) async {
|
||||
await bind.sessionSetKeyboardMode(
|
||||
id: widget.id, keyboardMode: newValue);
|
||||
await bind.sessionSetKeyboardMode(id: widget.id, value: newValue);
|
||||
widget.ffi.canvasModel.updateViewStyle();
|
||||
},
|
||||
)
|
||||
];
|
||||
|
||||
@@ -692,10 +692,11 @@ class _RemotePageState extends State<RemotePage> {
|
||||
}
|
||||
|
||||
void changePhysicalKeyboardInputMode() async {
|
||||
var current = await bind.sessionGetKeyboardName(id: widget.id);
|
||||
var current = await bind.sessionGetKeyboardMode(id: widget.id) ?? "legacy";
|
||||
gFFI.dialogManager.show((setState, close) {
|
||||
void setMode(String? v) async {
|
||||
await bind.sessionSetKeyboardMode(id: widget.id, keyboardMode: v ?? '');
|
||||
await bind.sessionPeerOption(
|
||||
id: widget.id, name: "keyboard-mode", value: v ?? "");
|
||||
setState(() => current = v ?? '');
|
||||
Future.delayed(Duration(milliseconds: 300), close);
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ class InputModel {
|
||||
InputModel(this.parent);
|
||||
|
||||
KeyEventResult handleRawKeyEvent(FocusNode data, RawKeyEvent e) {
|
||||
bind.sessionGetKeyboardName(id: id).then((result) {
|
||||
bind.sessionGetKeyboardMode(id: id).then((result) {
|
||||
keyboardMode = result.toString();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user