From 11b298d3ed7685d1969f0f10f776af4edf03527d Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Wed, 12 Aug 2020 22:52:38 -0700 Subject: [PATCH] window: add some more application keypad mappings @petermblair: I didn't test this beyond it compiling because I don't have any keyboards that have a keypad :-p --- window/src/os/xkeysyms.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/window/src/os/xkeysyms.rs b/window/src/os/xkeysyms.rs index b8cee4539..2b10fbd9a 100644 --- a/window/src/os/xkeysyms.rs +++ b/window/src/os/xkeysyms.rs @@ -96,6 +96,14 @@ pub fn keysym_to_keycode(keysym: u32) -> Option { KEY_KP_Subtract => KeyCode::Subtract, KEY_KP_Decimal => KeyCode::Decimal, KEY_KP_Separator => KeyCode::Separator, + KEY_KP_Space => KeyCode::Char(' '), + KEY_KP_Tab => KeyCode::Char('\t'), + KEY_KP_Left => KeyCode::ApplicationLeftArrow, + KEY_KP_Up => KeyCode::ApplicationUpArrow, + KEY_KP_Right => KeyCode::ApplicationRightArrow, + KEY_KP_Down => KeyCode::ApplicationDownArrow, + KEY_KP_Insert => KeyCode::Insert, + KEY_KP_Equal => KeyCode::Char('='), i @ KEY_KP_0..=KEY_KP_9 => KeyCode::Numpad((i - KEY_KP_0) as u8),