mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Pass all key events to the current constellation frame.
This commit is contained in:
parent
c5e1b0d32e
commit
1c64dabb15
7 changed files with 304 additions and 9 deletions
|
@ -11,6 +11,7 @@ use geom::scale_factor::ScaleFactor;
|
|||
use geom::size::TypedSize2D;
|
||||
use layers::geometry::DevicePixel;
|
||||
use layers::platform::surface::NativeGraphicsMetadata;
|
||||
use servo_msg::constellation_msg::{Key, KeyState};
|
||||
use servo_msg::compositor_msg::{ReadyState, RenderState};
|
||||
use servo_util::geometry::ScreenPx;
|
||||
use std::fmt::{FormatError, Formatter, Show};
|
||||
|
@ -58,6 +59,8 @@ pub enum WindowEvent {
|
|||
FinishedWindowEvent,
|
||||
/// Sent when the user quits the application
|
||||
QuitWindowEvent,
|
||||
/// Sent when a key input state changes
|
||||
KeyEvent(Key, KeyState),
|
||||
}
|
||||
|
||||
impl Show for WindowEvent {
|
||||
|
@ -66,6 +69,7 @@ impl Show for WindowEvent {
|
|||
IdleWindowEvent => write!(f, "Idle"),
|
||||
RefreshWindowEvent => write!(f, "Refresh"),
|
||||
ResizeWindowEvent(..) => write!(f, "Resize"),
|
||||
KeyEvent(..) => write!(f, "Key"),
|
||||
LoadUrlWindowEvent(..) => write!(f, "LoadUrl"),
|
||||
MouseWindowEventClass(..) => write!(f, "Mouse"),
|
||||
MouseWindowMoveEventClass(..) => write!(f, "MouseMove"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue