allow swap key

This commit is contained in:
sjpark
2023-02-08 21:45:10 +09:00
parent 993e2d9c77
commit 4bd4fba533
8 changed files with 228 additions and 0 deletions

View File

@@ -36,6 +36,7 @@ pub struct Session<T: InvokeUiSession> {
pub sender: Arc<RwLock<Option<mpsc::UnboundedSender<Data>>>>,
pub thread: Arc<Mutex<Option<std::thread::JoinHandle<()>>>>,
pub ui_handler: T,
pub allow_swap_key: bool,
}
impl<T: InvokeUiSession> Session<T> {
@@ -505,6 +506,15 @@ impl<T: InvokeUiSession> Session<T> {
shift: bool,
command: bool,
) {
#[cfg(target_os = "macos")]
let (ctrl, command) =
if self.allow_swap_key {
(command, ctrl)
}
else {
(ctrl, command)
};
#[allow(unused_mut)]
let mut command = command;
#[cfg(windows)]