x11: Support numpad arrows/Home/End/PageUp/PageDown/Insert/Delete (#396)

This commit is contained in:
forbjok 2018-03-23 10:36:04 +01:00 committed by Pierre Krieger
parent bbcd3019e8
commit 7a1946589c
2 changed files with 12 additions and 10 deletions

View file

@ -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`.

View file

@ -67,19 +67,19 @@ pub fn keysym_to_element(keysym: libc::c_uint) -> Option<VirtualKeyCode> {
//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,