From 7764f80eabefc76e0939aaa1eb18576d90da82bc Mon Sep 17 00:00:00 2001 From: Federico Terzi Date: Tue, 10 Mar 2020 18:07:50 +0100 Subject: [PATCH] Implement specific key modifiers on macOS. See #117 --- src/context/macos.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/context/macos.rs b/src/context/macos.rs index b3f621f..0f31d21 100644 --- a/src/context/macos.rs +++ b/src/context/macos.rs @@ -123,10 +123,14 @@ extern fn keypress_callback(_self: *mut c_void, raw_buffer: *const u8, len: i32, } }else if event_type == 1 { // Modifier event let modifier: Option = match key_code { - 0x37 => Some(META), - 0x38 => Some(SHIFT), - 0x3A => Some(ALT), - 0x3B => Some(CTRL), + 0x37 => Some(LEFT_META), + 0x36 => Some(RIGHT_META), + 0x38 => Some(LEFT_SHIFT), + 0x3C => Some(RIGHT_SHIFT), + 0x3A => Some(LEFT_ALT), + 0x3D => Some(RIGHT_ALT), + 0x3B => Some(LEFT_CTRL), + 0x3E => Some(RIGHT_CTRL), 0x33 => Some(BACKSPACE), _ => None, };