From edf396b1a49836c4bbdf8b7fcb2341bfdb29194a Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 10 Nov 2020 22:55:29 +0100 Subject: [PATCH] On Wayland, add missing mappings for numpad arrows The mappings for 'keysyms::XKB_KEY_KP_{Up,Down,Left,Rigt}' were missing making the arrow keys on the numpad not sending proper 'VirtualKeyCode's. --- CHANGELOG.md | 1 + src/platform_impl/linux/wayland/seat/keyboard/keymap.rs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 903c3c70..fa17fc79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - On Web, fix `WindowEvent::ReceivedCharacter` never being sent on key input. - On macOS, fix compilation when targeting aarch64 - On X11, fix `Window::request_redraw` not waking the event loop. +- On Wayland, the keypad arrow keys are now recognized. # 0.23.0 (2020-10-02) diff --git a/src/platform_impl/linux/wayland/seat/keyboard/keymap.rs b/src/platform_impl/linux/wayland/seat/keyboard/keymap.rs index 717a68df..991afff2 100644 --- a/src/platform_impl/linux/wayland/seat/keyboard/keymap.rs +++ b/src/platform_impl/linux/wayland/seat/keyboard/keymap.rs @@ -149,6 +149,10 @@ pub fn keysym_to_vkey(keysym: u32) -> Option { keysyms::XKB_KEY_KP_Page_Down => Some(VirtualKeyCode::PageDown), keysyms::XKB_KEY_KP_Home => Some(VirtualKeyCode::Home), keysyms::XKB_KEY_KP_End => Some(VirtualKeyCode::End), + keysyms::XKB_KEY_KP_Left => Some(VirtualKeyCode::Left), + keysyms::XKB_KEY_KP_Up => Some(VirtualKeyCode::Up), + keysyms::XKB_KEY_KP_Right => Some(VirtualKeyCode::Right), + keysyms::XKB_KEY_KP_Down => Some(VirtualKeyCode::Down), // => Some(VirtualKeyCode::OEM102), keysyms::XKB_KEY_period => Some(VirtualKeyCode::Period), // => Some(VirtualKeyCode::Playpause),