diff options
author | Manish Goregaokar <manishsmail@gmail.com> | 2016-03-22 20:21:58 +0530 |
---|---|---|
committer | Manish Goregaokar <manishsmail@gmail.com> | 2016-03-22 21:03:56 +0530 |
commit | f3162cd31616ff2584e34aeacba98e7fd7efa608 (patch) | |
tree | 416feee518ee605819082bddc1ce1864fd91e7f1 /components/script/dom/keyboardevent.rs | |
parent | 327f1c1eb8a31f1e595d1996b1a8153701ebfa2f (diff) | |
download | servo-f3162cd31616ff2584e34aeacba98e7fd7efa608.tar.gz servo-f3162cd31616ff2584e34aeacba98e7fd7efa608.zip |
Add support for navigation keys
Diffstat (limited to 'components/script/dom/keyboardevent.rs')
-rw-r--r-- | components/script/dom/keyboardevent.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/components/script/dom/keyboardevent.rs b/components/script/dom/keyboardevent.rs index 9feb08b7674..8075a18433a 100644 --- a/components/script/dom/keyboardevent.rs +++ b/components/script/dom/keyboardevent.rs @@ -319,6 +319,8 @@ pub fn key_value(key: Key, mods: KeyModifiers) -> &'static str { Key::RightAlt => "Alt", Key::RightSuper => "Super", Key::Menu => "ContextMenu", + Key::NavigateForward => "BrowserForward", + Key::NavigateBackward => "BrowserBack", } } @@ -489,6 +491,8 @@ fn key_from_string(key_string: &str, location: u32) -> Option<Key> { "Alt" if location == KeyboardEventConstants::DOM_KEY_LOCATION_RIGHT => Some(Key::RightAlt), "Super" if location == KeyboardEventConstants::DOM_KEY_LOCATION_RIGHT => Some(Key::RightSuper), "ContextMenu" => Some(Key::Menu), + "BrowserForward" => Some(Key::NavigateForward), + "BrowserBack" => Some(Key::NavigateBackward), _ => None } } @@ -614,6 +618,9 @@ fn code_value(key: Key) -> &'static str { Key::LeftAlt | Key::RightAlt => "Alt", Key::LeftSuper | Key::RightSuper => "Super", Key::Menu => "Menu", + + Key::NavigateForward => "BrowserForward", + Key::NavigateBackward => "BrowserBackward", } } |