aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortomaka <pierre.krieger1708@gmail.com>2016-03-17 12:45:58 +0100
committertomaka <pierre.krieger1708@gmail.com>2016-03-17 12:45:58 +0100
commit45d25471c381fac929e93c37175007209a7feb33 (patch)
treeebc8e020e6c1e6f62f5990bbc891cbbbf28a3eff
parenta3543b700f4982a470037cd059928aed533b887c (diff)
parent1de66e4efbd428e5cefa422e6c771e225cab1829 (diff)
downloadglutin-45d25471c381fac929e93c37175007209a7feb33.tar.gz
glutin-45d25471c381fac929e93c37175007209a7feb33.zip
Merge pull request #730 from Manishearth/nav
Add support for navigation keys
-rw-r--r--Cargo.toml18
-rw-r--r--src/api/win32/event.rs8
-rw-r--r--src/api/x11/events.rs3
-rw-r--r--src/events.rs2
4 files changed, 18 insertions, 13 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 3a251c2..294d55d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -81,60 +81,60 @@ osmesa-sys = "0.0.5"
wayland-client = { version = "0.5.4", features = ["egl", "dlopen"] }
wayland-kbd = "0.3.3"
wayland-window = "0.2.2"
-x11-dl = "~2.3"
+x11-dl = "~2.4"
[target.i586-unknown-linux-gnu.dependencies]
osmesa-sys = "0.0.5"
wayland-client = { version = "0.5.4", features = ["egl", "dlopen"] }
wayland-kbd = "0.3.3"
wayland-window = "0.2.2"
-x11-dl = "~2.3"
+x11-dl = "~2.4"
[target.x86_64-unknown-linux-gnu.dependencies]
osmesa-sys = "0.0.5"
wayland-client = { version = "0.5.4", features = ["egl", "dlopen"] }
wayland-kbd = "0.3.3"
wayland-window = "0.2.2"
-x11-dl = "~2.3"
+x11-dl = "~2.4"
[target.arm-unknown-linux-gnueabihf.dependencies]
osmesa-sys = "0.0.5"
wayland-client = { version = "0.5.4", features = ["egl", "dlopen"] }
wayland-kbd = "0.3.3"
wayland-window = "0.2.2"
-x11-dl = "~2.3"
+x11-dl = "~2.4"
[target.armv7-unknown-linux-gnueabihf.dependencies]
osmesa-sys = "0.0.5"
wayland-client = { version = "0.5.4", features = ["egl", "dlopen"] }
wayland-kbd = "0.3.3"
wayland-window = "0.2.2"
-x11-dl = "~2.3"
+x11-dl = "~2.4"
[target.aarch64-unknown-linux-gnu.dependencies]
osmesa-sys = "0.0.5"
wayland-client = { version = "0.5.4", features = ["egl", "dlopen"] }
wayland-kbd = "0.3.3"
wayland-window = "0.2.2"
-x11-dl = "~2.3"
+x11-dl = "~2.4"
[target.x86_64-unknown-dragonfly.dependencies]
osmesa-sys = "0.0.5"
wayland-client = { version = "0.5.4", features = ["egl", "dlopen"] }
wayland-kbd = "0.3.3"
wayland-window = "0.2.2"
-x11-dl = "~2.3"
+x11-dl = "~2.4"
[target.x86_64-unknown-freebsd.dependencies]
osmesa-sys = "0.0.5"
wayland-client = { version = "0.5.4", features = ["egl", "dlopen"] }
wayland-kbd = "0.3.3"
wayland-window = "0.2.2"
-x11-dl = "~2.3"
+x11-dl = "~2.4"
[target.x86_64-unknown-openbsd.dependencies]
osmesa-sys = "0.0.5"
wayland-client = { version = "0.5.4", features = ["egl", "dlopen"] }
wayland-kbd = "0.3.3"
wayland-window = "0.2.2"
-x11-dl = "~2.3"
+x11-dl = "~2.4"
diff --git a/src/api/win32/event.rs b/src/api/win32/event.rs
index ad4598a..f60ec7e 100644
--- a/src/api/win32/event.rs
+++ b/src/api/win32/event.rs
@@ -148,10 +148,10 @@ pub fn vkeycode_to_element(wparam: winapi::WPARAM, lparam: winapi::LPARAM) -> (S
winapi::VK_LCONTROL => Some(VirtualKeyCode::Lcontrol),
winapi::VK_RCONTROL => Some(VirtualKeyCode::Rcontrol),
winapi::VK_LMENU => Some(VirtualKeyCode::Lmenu),
- winapi::VK_RMENU => Some(VirtualKeyCode::Rmenu),
- winapi::VK_BROWSER_BACK => Some(VirtualKeyCode::Browser_back),
- winapi::VK_BROWSER_FORWARD => Some(VirtualKeyCode::Browser_forward),
- winapi::VK_BROWSER_REFRESH => Some(VirtualKeyCode::Browser_refresh),
+ winapi::VK_RMENU => Some(VirtualKeyCode::Rmenu),*/
+ winapi::VK_BROWSER_BACK => Some(VirtualKeyCode::NavigateBackward),
+ winapi::VK_BROWSER_FORWARD => Some(VirtualKeyCode::NavigateForward),
+ /*winapi::VK_BROWSER_REFRESH => Some(VirtualKeyCode::Browser_refresh),
winapi::VK_BROWSER_STOP => Some(VirtualKeyCode::Browser_stop),
winapi::VK_BROWSER_SEARCH => Some(VirtualKeyCode::Browser_search),
winapi::VK_BROWSER_FAVORITES => Some(VirtualKeyCode::Browser_favorites),
diff --git a/src/api/x11/events.rs b/src/api/x11/events.rs
index 408a3ec..d497319 100644
--- a/src/api/x11/events.rs
+++ b/src/api/x11/events.rs
@@ -3,6 +3,7 @@ use super::ffi;
use VirtualKeyCode;
pub fn keycode_to_element(scancode: libc::c_uint) -> Option<VirtualKeyCode> {
+ println!("{:?}", scancode);
Some(match scancode {
ffi::XK_BackSpace => events::VirtualKeyCode::Back,
ffi::XK_Tab => events::VirtualKeyCode::Tab,
@@ -997,6 +998,8 @@ pub fn keycode_to_element(scancode: libc::c_uint) -> Option<VirtualKeyCode> {
//ffi::XK_hebrew_taw => events::VirtualKeyCode::Hebrew_taw,
//ffi::XK_hebrew_taf => events::VirtualKeyCode::Hebrew_taf,
//ffi::XK_Hebrew_switch => events::VirtualKeyCode::Hebrew_switch,
+ ffi::XF86XK_Back => VirtualKeyCode::NavigateBackward,
+ ffi::XF86XK_Forward => VirtualKeyCode::NavigateForward,
_ => return None
})
}
diff --git a/src/events.rs b/src/events.rs
index 8049c16..9fff1fb 100644
--- a/src/events.rs
+++ b/src/events.rs
@@ -264,6 +264,8 @@ pub enum VirtualKeyCode {
Multiply,
Mute,
MyComputer,
+ NavigateForward, // also called "Prior"
+ NavigateBackward, // also called "Next"
NextTrack,
NoConvert,
NumpadComma,