mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Use keyboard-types crate
Have embedders send DOM keys to servo and use a strongly typed KeyboardEvent from the W3C UI Events spec. All keyboard handling now uses the new types. Introduce a ShortcutMatcher to recognize key bindings. Shortcuts are now recognized in a uniform way. Updated the winit port. Updated webdriver integration. part of #20331
This commit is contained in:
parent
76ddbe4d7a
commit
0ccaa7e1a9
35 changed files with 762 additions and 1604 deletions
|
@ -8,7 +8,8 @@ use embedder_traits::EventLoopWaker;
|
|||
use euclid::TypedScale;
|
||||
#[cfg(feature = "gleam")]
|
||||
use gleam::gl;
|
||||
use msg::constellation_msg::{Key, KeyModifiers, KeyState, TopLevelBrowsingContextId, TraversalDirection};
|
||||
use keyboard_types::KeyboardEvent;
|
||||
use msg::constellation_msg::{TopLevelBrowsingContextId, TraversalDirection};
|
||||
use script_traits::{MouseButton, TouchEventType, TouchId};
|
||||
use servo_geometry::{DeviceIndependentPixel, DeviceUintLength};
|
||||
use servo_url::ServoUrl;
|
||||
|
@ -70,7 +71,7 @@ pub enum WindowEvent {
|
|||
/// Sent when the user quits the application
|
||||
Quit,
|
||||
/// Sent when a key input state changes
|
||||
KeyEvent(Option<char>, Key, KeyState, KeyModifiers),
|
||||
Keyboard(KeyboardEvent),
|
||||
/// Sent when Ctr+R/Apple+R is called to reload the current page.
|
||||
Reload(TopLevelBrowsingContextId),
|
||||
/// Create a new top level browsing context
|
||||
|
@ -94,7 +95,7 @@ impl Debug for WindowEvent {
|
|||
WindowEvent::Idle => write!(f, "Idle"),
|
||||
WindowEvent::Refresh => write!(f, "Refresh"),
|
||||
WindowEvent::Resize => write!(f, "Resize"),
|
||||
WindowEvent::KeyEvent(..) => write!(f, "Key"),
|
||||
WindowEvent::Keyboard(..) => write!(f, "Keyboard"),
|
||||
WindowEvent::LoadUrl(..) => write!(f, "LoadUrl"),
|
||||
WindowEvent::MouseWindowEventClass(..) => write!(f, "Mouse"),
|
||||
WindowEvent::MouseWindowMoveEventClass(..) => write!(f, "MouseMove"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue