From 1285bc20cfcf9c629440574b36946171a717bc12 Mon Sep 17 00:00:00 2001 From: Federico Terzi Date: Tue, 10 Mar 2020 18:51:11 +0100 Subject: [PATCH] Implement more specific KeyModifiers on Linux. Fix #117 --- src/context/linux.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/context/linux.rs b/src/context/linux.rs index 95186b2..876db30 100644 --- a/src/context/linux.rs +++ b/src/context/linux.rs @@ -114,11 +114,16 @@ 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 { - 133 => Some(META), - 50 => Some(SHIFT), - 64 => Some(ALT), - 37 => Some(CTRL), + 133 => Some(LEFT_META), + 134 => Some(RIGHT_META), + 50 => Some(LEFT_SHIFT), + 62 => Some(RIGHT_SHIFT), + 64 => Some(LEFT_ALT), + 108 => Some(RIGHT_ALT), + 37 => Some(LEFT_CTRL), + 105 => Some(RIGHT_CTRL), 22 => Some(BACKSPACE), _ => None, };