diff options
Diffstat (limited to 'components/compositing/compositor.rs')
-rw-r--r-- | components/compositing/compositor.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 95714929ad2..e20ea06f0e8 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -19,7 +19,7 @@ use windowing::{MouseWindowEvent, MouseWindowEventClass, MouseWindowMouseDownEve use windowing::{MouseWindowMouseUpEvent, MouseWindowMoveEventClass, NavigationWindowEvent}; use windowing::{QuitWindowEvent, RefreshWindowEvent, ResizeWindowEvent, ScrollWindowEvent}; use windowing::{WindowEvent, WindowMethods, WindowNavigateMsg, ZoomWindowEvent}; -use windowing::{PinchZoomWindowEvent}; +use windowing::{PinchZoomWindowEvent, KeyEvent}; use azure::azure_hl; use std::cmp; @@ -43,7 +43,7 @@ use servo_msg::compositor_msg::{Blank, Epoch, FinishedLoading, IdleRenderState, use servo_msg::compositor_msg::{ReadyState, RenderingRenderState, RenderState, Scrollable}; use servo_msg::constellation_msg::{ConstellationChan, ExitMsg, LoadUrlMsg}; use servo_msg::constellation_msg::{NavigateMsg, LoadData, PipelineId, ResizedWindowMsg}; -use servo_msg::constellation_msg::{WindowSizeData}; +use servo_msg::constellation_msg::{WindowSizeData, KeyState, Key, KeyModifiers}; use servo_msg::constellation_msg; use servo_util::geometry::{PagePx, ScreenPx, ViewportPx}; use servo_util::memory::MemoryProfilerChan; @@ -707,6 +707,10 @@ impl<Window: WindowMethods> IOCompositor<Window> { self.on_navigation_window_event(direction); } + KeyEvent(key, state, modifiers) => { + self.on_key_event(key, state, modifiers); + } + FinishedWindowEvent => { let exit = opts::get().exit_after_load; if exit { @@ -878,6 +882,11 @@ impl<Window: WindowMethods> IOCompositor<Window> { chan.send(NavigateMsg(direction)) } + fn on_key_event(&self, key: Key, state: KeyState, modifiers: KeyModifiers) { + let ConstellationChan(ref chan) = self.constellation_chan; + chan.send(constellation_msg::KeyEvent(key, state, modifiers)) + } + fn convert_buffer_requests_to_pipeline_requests_map(&self, requests: Vec<(Rc<Layer<CompositorData>>, Vec<BufferRequest>)>) -> |