Pass all key events to the current constellation frame.

This commit is contained in:
Josh Matthews 2014-10-02 03:11:50 -04:00
parent c5e1b0d32e
commit 1c64dabb15
7 changed files with 304 additions and 9 deletions

View file

@ -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"),