mirror of
https://github.com/servo/servo.git
synced 2025-10-01 09:09:15 +01:00
Add support for navigation keys
This commit is contained in:
parent
327f1c1eb8
commit
f3162cd316
3 changed files with 18 additions and 0 deletions
|
@ -498,6 +498,8 @@ impl Window {
|
|||
VirtualKeyCode::Tab => Ok(Key::Tab),
|
||||
VirtualKeyCode::Subtract => Ok(Key::Minus),
|
||||
|
||||
VirtualKeyCode::NavigateBackward => Ok(Key::NavigateBackward),
|
||||
VirtualKeyCode::NavigateForward => Ok(Key::NavigateForward),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
@ -731,6 +733,12 @@ impl WindowMethods for Window {
|
|||
(NONE, Key::Backspace) => {
|
||||
self.event_queue.borrow_mut().push(WindowEvent::Navigation(WindowNavigateMsg::Back));
|
||||
}
|
||||
(SHIFT, Key::NavigateForward) => {
|
||||
self.event_queue.borrow_mut().push(WindowEvent::Navigation(WindowNavigateMsg::Forward));
|
||||
}
|
||||
(NONE, Key::NavigateBackward) => {
|
||||
self.event_queue.borrow_mut().push(WindowEvent::Navigation(WindowNavigateMsg::Back));
|
||||
}
|
||||
|
||||
(NONE, Key::Escape) => {
|
||||
self.event_queue.borrow_mut().push(WindowEvent::Quit);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue