Skip to content

Commit

Permalink
x11: Support numpad arrows/Home/End/PageUp/PageDown/Insert/Delete (#396)
Browse files Browse the repository at this point in the history
  • Loading branch information
forbjok authored and tomaka committed Mar 23, 2018
1 parent bbcd301 commit 7a19465
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
20 changes: 10 additions & 10 deletions src/platform/linux/x11/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 7a19465

Please sign in to comment.