Changed Msg::KeyEvent to take in KeyState and moved the checks in CompositorTask::send_key_event to Compositor::handle_browser_message

This commit is contained in:
Keith Yeung 2015-02-04 10:30:23 +08:00
parent b262fc16e0
commit 37cb876f4e
3 changed files with 7 additions and 7 deletions

View file

@ -358,8 +358,10 @@ impl<Window: WindowMethods> IOCompositor<Window> {
}
}
(Msg::KeyEvent(key, modified), ShutdownState::NotShuttingDown) => {
self.window.handle_key(key, modified);
(Msg::KeyEvent(key, state, modified), ShutdownState::NotShuttingDown) => {
if state == KeyState::Pressed {
self.window.handle_key(key, modified);
}
}
(Msg::SetCursor(cursor), ShutdownState::NotShuttingDown) => {