mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +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
|
@ -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};
|
||||
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) => {
|
||||
self.on_key_event(key, state);
|
||||
}
|
||||
|
||||
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) {
|
||||
let ConstellationChan(ref chan) = self.constellation_chan;
|
||||
chan.send(constellation_msg::KeyEvent(key, state))
|
||||
}
|
||||
|
||||
fn convert_buffer_requests_to_pipeline_requests_map(&self,
|
||||
requests: Vec<(Rc<Layer<CompositorData>>,
|
||||
Vec<BufferRequest>)>) ->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue