OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/sticky_keys/sticky_keys_controller.h" | 5 #include "ash/sticky_keys/sticky_keys_controller.h" |
6 | 6 |
7 #if defined(USE_X11) | 7 #if defined(USE_X11) |
8 #include <X11/extensions/XInput2.h> | 8 #include <X11/extensions/XInput2.h> |
9 #include <X11/Xlib.h> | 9 #include <X11/Xlib.h> |
10 #undef RootWindow | 10 #undef RootWindow |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 bool StickyKeysController::HandleScrollEvent(ui::ScrollEvent* event) { | 174 bool StickyKeysController::HandleScrollEvent(ui::ScrollEvent* event) { |
175 return shift_sticky_key_->HandleScrollEvent(event) || | 175 return shift_sticky_key_->HandleScrollEvent(event) || |
176 alt_sticky_key_->HandleScrollEvent(event) || | 176 alt_sticky_key_->HandleScrollEvent(event) || |
177 altgr_sticky_key_->HandleScrollEvent(event) || | 177 altgr_sticky_key_->HandleScrollEvent(event) || |
178 ctrl_sticky_key_->HandleScrollEvent(event) || | 178 ctrl_sticky_key_->HandleScrollEvent(event) || |
179 mod3_sticky_key_->HandleScrollEvent(event); | 179 mod3_sticky_key_->HandleScrollEvent(event); |
180 } | 180 } |
181 | 181 |
182 void StickyKeysController::OnKeyEvent(ui::KeyEvent* event) { | 182 void StickyKeysController::OnKeyEvent(ui::KeyEvent* event) { |
183 // Do not consume a translated key event which is generated by an IME. | 183 // Do not consume a translated key event which is generated by an IME. |
184 if (event->type() == ui::ET_TRANSLATED_KEY_PRESS || | 184 if (event->IsTranslated()) |
185 event->type() == ui::ET_TRANSLATED_KEY_RELEASE) { | |
186 return; | 185 return; |
187 } | |
188 | 186 |
189 if (enabled_) { | 187 if (enabled_) { |
190 if (HandleKeyEvent(event)) | 188 if (HandleKeyEvent(event)) |
191 event->StopPropagation(); | 189 event->StopPropagation(); |
192 UpdateOverlay(); | 190 UpdateOverlay(); |
193 } | 191 } |
194 } | 192 } |
195 | 193 |
196 void StickyKeysController::OnMouseEvent(ui::MouseEvent* event) { | 194 void StickyKeysController::OnMouseEvent(ui::MouseEvent* event) { |
197 if (enabled_) { | 195 if (enabled_) { |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 &xievent->mods.effective)); | 542 &xievent->mods.effective)); |
545 } | 543 } |
546 } | 544 } |
547 #elif defined(USE_OZONE) | 545 #elif defined(USE_OZONE) |
548 NOTIMPLEMENTED() << "Modifier key is not handled"; | 546 NOTIMPLEMENTED() << "Modifier key is not handled"; |
549 #endif | 547 #endif |
550 event->set_flags(event->flags() | modifier_flag_); | 548 event->set_flags(event->flags() | modifier_flag_); |
551 } | 549 } |
552 | 550 |
553 } // namespace ash | 551 } // namespace ash |
OLD | NEW |