Merge pull request #3121 from sj6219/sigma

allow swap key
This commit is contained in:
RustDesk
2023-02-28 15:28:35 +08:00
committed by GitHub
5 changed files with 125 additions and 2 deletions

View File

@@ -920,6 +920,7 @@ class _DisplayMenuState extends State<_DisplayMenu> {
disableClipboard(),
lockAfterSessionEnd(),
privacyMode(),
swapKey(),
]);
}
@@ -1528,6 +1529,23 @@ class _DisplayMenuState extends State<_DisplayMenu> {
ffi: widget.ffi,
child: Text(translate('Privacy mode')));
}
swapKey() {
final visible = perms['keyboard'] != false &&
((Platform.isMacOS && pi.platform != kPeerPlatformMacOS) ||
(!Platform.isMacOS && pi.platform == kPeerPlatformMacOS));
if (!visible) return Offstage();
final option = 'allow_swap_key';
final value = bind.sessionGetToggleOptionSync(id: widget.id, arg: option);
return _CheckboxMenuButton(
value: value,
onChanged: (value) {
if (value == null) return;
bind.sessionToggleOption(id: widget.id, value: option);
},
ffi: widget.ffi,
child: Text(translate('Swap control-command key')));
}
}
class _KeyboardMenu extends StatelessWidget {