diff --git a/Cargo.lock b/Cargo.lock index a4e92455b7..b074e5c350 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -794,7 +794,7 @@ dependencies = [ [[package]] name = "druid" version = "0.7.0" -source = "git+https://github.com/lapce/druid?branch=shell_opengl#46218825af3901ffddece713543837c365403da0" +source = "git+https://github.com/lapce/druid?branch=shell_opengl#85d503a79df7581d1a144f97ee1cc369788b55b8" dependencies = [ "console_error_panic_hook", "druid-derive", @@ -817,7 +817,7 @@ dependencies = [ [[package]] name = "druid-derive" version = "0.4.0" -source = "git+https://github.com/lapce/druid?branch=shell_opengl#46218825af3901ffddece713543837c365403da0" +source = "git+https://github.com/lapce/druid?branch=shell_opengl#85d503a79df7581d1a144f97ee1cc369788b55b8" dependencies = [ "proc-macro2", "quote", @@ -827,7 +827,7 @@ dependencies = [ [[package]] name = "druid-shell" version = "0.7.0" -source = "git+https://github.com/lapce/druid?branch=shell_opengl#46218825af3901ffddece713543837c365403da0" +source = "git+https://github.com/lapce/druid?branch=shell_opengl#85d503a79df7581d1a144f97ee1cc369788b55b8" dependencies = [ "anyhow", "bitflags", diff --git a/lapce-data/src/keypress/mod.rs b/lapce-data/src/keypress/mod.rs index 04424aa89a..56f16ca551 100644 --- a/lapce-data/src/keypress/mod.rs +++ b/lapce-data/src/keypress/mod.rs @@ -318,7 +318,7 @@ impl KeyPressData { focus: &mut T, env: &Env, ) -> bool { - println!("Keypress: {key_event:?}"); + log::info!("Keypress: {key_event:?}"); // We are removing Shift modifier since the character is already upper case. let mods = Self::get_key_modifiers(key_event); @@ -393,12 +393,22 @@ impl KeyPressData { self.count = None; - if keypress.mods.is_empty() || keypress.mods == Modifiers::SHIFT { + #[cfg(not(target_os = "macos"))] + if (keypress.mods - Modifiers::SHIFT).is_empty() { if let druid::KbKey::Character(c) = &key_event.key { focus.receive_char(ctx, c); return true; } } + + #[cfg(target_os = "macos")] + if (keypress.mods - (Modifiers::SHIFT | Modifiers::ALT)).is_empty() { + if let druid::KbKey::Character(c) = &key_event.key { + focus.receive_char(ctx, c); + return true; + } + } + false }