diff --git a/CHANGELOG.md b/CHANGELOG.md index 87c6c17f..2a6903ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ `with_title_hidden`, `with_titlebar_buttons_hidden`, `with_fullsize_content_view`. +- Mapped X11 numpad keycodes (arrows, Home, End, PageUp, PageDown, Insert and Delete) to corresponding virtual keycodes + # Version 0.11.2 (2018-03-06) - Impl `Hash`, `PartialEq`, and `Eq` for `events::ModifiersState`. diff --git a/src/platform/linux/x11/events.rs b/src/platform/linux/x11/events.rs index c17cfe7c..77543652 100644 --- a/src/platform/linux/x11/events.rs +++ b/src/platform/linux/x11/events.rs @@ -67,19 +67,19 @@ pub fn keysym_to_element(keysym: libc::c_uint) -> Option { //ffi::XK_KP_F2 => events::VirtualKeyCode::Kp_f2, //ffi::XK_KP_F3 => events::VirtualKeyCode::Kp_f3, //ffi::XK_KP_F4 => events::VirtualKeyCode::Kp_f4, - //ffi::XK_KP_Home => events::VirtualKeyCode::Kp_home, - //ffi::XK_KP_Left => events::VirtualKeyCode::NumpadLeft, - //ffi::XK_KP_Up => events::VirtualKeyCode::NumpadUp, - //ffi::XK_KP_Right => events::VirtualKeyCode::NumpadRight, - //ffi::XK_KP_Down => events::VirtualKeyCode::NumpadDown, + ffi::XK_KP_Home => events::VirtualKeyCode::Home, + ffi::XK_KP_Left => events::VirtualKeyCode::Left, + ffi::XK_KP_Up => events::VirtualKeyCode::Up, + ffi::XK_KP_Right => events::VirtualKeyCode::Right, + ffi::XK_KP_Down => events::VirtualKeyCode::Down, //ffi::XK_KP_Prior => events::VirtualKeyCode::Kp_prior, - //ffi::XK_KP_Page_Up => events::VirtualKeyCode::NumpadPageUp, + ffi::XK_KP_Page_Up => events::VirtualKeyCode::PageUp, //ffi::XK_KP_Next => events::VirtualKeyCode::Kp_next, - //ffi::XK_KP_Page_Down => events::VirtualKeyCode::NumpadPageDown, - //ffi::XK_KP_End => events::VirtualKeyCode::NumpadEnd, + ffi::XK_KP_Page_Down => events::VirtualKeyCode::PageDown, + ffi::XK_KP_End => events::VirtualKeyCode::End, //ffi::XK_KP_Begin => events::VirtualKeyCode::Kp_begin, - //ffi::XK_KP_Insert => events::VirtualKeyCode::NumpadInsert, - //ffi::XK_KP_Delete => events::VirtualKeyCode::NumpadDelete, + ffi::XK_KP_Insert => events::VirtualKeyCode::Insert, + ffi::XK_KP_Delete => events::VirtualKeyCode::Delete, ffi::XK_KP_Equal => events::VirtualKeyCode::NumpadEquals, //ffi::XK_KP_Multiply => events::VirtualKeyCode::NumpadMultiply, //ffi::XK_KP_Add => events::VirtualKeyCode::NumpadAdd,