mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Dispatch keydown, keyup, and keypress events at appropriate times.
This commit is contained in:
parent
e999843183
commit
329ba56fca
8 changed files with 124 additions and 19 deletions
|
@ -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, KeyState, Key};
|
||||
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,8 +707,8 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
|||
self.on_navigation_window_event(direction);
|
||||
}
|
||||
|
||||
KeyEvent(key, state) => {
|
||||
self.on_key_event(key, state);
|
||||
KeyEvent(key, state, modifiers) => {
|
||||
self.on_key_event(key, state, modifiers);
|
||||
}
|
||||
|
||||
FinishedWindowEvent => {
|
||||
|
@ -882,9 +882,9 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
|||
chan.send(NavigateMsg(direction))
|
||||
}
|
||||
|
||||
fn on_key_event(&self, key: Key, state: KeyState) {
|
||||
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))
|
||||
chan.send(constellation_msg::KeyEvent(key, state, modifiers))
|
||||
}
|
||||
|
||||
fn convert_buffer_requests_to_pipeline_requests_map(&self,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue