Add workaround for Nordic keyboard

macos-click-through
mewhhaha 5 years ago
parent 0d0792fddb
commit f3f441bb86

@ -46,9 +46,9 @@ pub fn parse_keycode(keycode: Keycode) -> Option<(&'static str, bool)> {
Keycode::Num9 => Some(("9", false)), Keycode::Num9 => Some(("9", false)),
Keycode::Colon => Some((":", false)), Keycode::Colon => Some((":", false)),
Keycode::Semicolon => Some((";", false)), Keycode::Semicolon => Some((";", false)),
Keycode::Less => Some(("lt", true)), Keycode::Less => Some(("lt", false)),
Keycode::Equals => Some(("=", false)), Keycode::Equals => Some(("=", false)),
Keycode::Greater => Some(("gt", true)), Keycode::Greater => Some(("gt", false)),
Keycode::Question => Some(("?", false)), Keycode::Question => Some(("?", false)),
Keycode::At => Some(("@", false)), Keycode::At => Some(("@", false)),
Keycode::LeftBracket => Some(("[", false)), Keycode::LeftBracket => Some(("[", false)),

@ -126,8 +126,11 @@ impl WindowWrapper {
pub fn handle_key_down(&mut self, keycode: Keycode, modifiers: Mod) { pub fn handle_key_down(&mut self, keycode: Keycode, modifiers: Mod) {
trace!("KeyDown Received: {}", keycode); trace!("KeyDown Received: {}", keycode);
const ALTGR: Mod = Mod::from_bits_truncate(0x0240);
if let Some((key_text, special)) = parse_keycode(keycode) { if let Some((key_text, special)) = parse_keycode(keycode) {
let will_text_input = let will_text_input =
modifiers.contains(ALTGR) ||
!modifiers.contains(Mod::LCTRLMOD) && !modifiers.contains(Mod::LCTRLMOD) &&
!modifiers.contains(Mod::RCTRLMOD) && !modifiers.contains(Mod::RCTRLMOD) &&
!modifiers.contains(Mod::LALTMOD) && !modifiers.contains(Mod::LALTMOD) &&

Loading…
Cancel
Save