Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(797)

Unified Diff: ui/wm/core/accelerator_filter.cc

Issue 1117173003: Converting (Alt+LeftClick -> RightClick) to (Search+LeftClick -> RightClick) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a test, and addressed comments Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/wm/core/accelerator_filter.cc
diff --git a/ui/wm/core/accelerator_filter.cc b/ui/wm/core/accelerator_filter.cc
index 12e91316d21ce81ce0c8906c851bf13f24cedf83..d598ddfe64f8fe6847d1af1b53d33e59dcb503d7 100644
--- a/ui/wm/core/accelerator_filter.cc
+++ b/ui/wm/core/accelerator_filter.cc
@@ -71,6 +71,18 @@ void AcceleratorFilter::OnKeyEvent(ui::KeyEvent* event) {
event->StopPropagation();
}
+void AcceleratorFilter::OnMouseEvent(ui::MouseEvent* event) {
+ // When a mouse event is interleaved between two key accelerators, we must
+ // store this event as an empty default accelerator in the accelerator
+ // history, so that the |AcceleratorController| can notice that something
+ // actually happend between those two key accelerators.
+ // We ignore synthesized mouse events.
+ if (event->flags() & ui::EF_IS_SYNTHESIZED)
+ return;
sadrul 2015/05/04 17:16:17 Remove the check for synthesized event if it isn't
afakhry 2015/05/04 20:17:08 Done.
+
+ accelerator_history_->StoreCurrentAccelerator(ui::Accelerator());
+}
+
ui::Accelerator CreateAcceleratorFromKeyEvent(const ui::KeyEvent& key_event) {
const int kModifierFlagMask =
(ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN);
« ash/accelerators/accelerator_filter_unittest.cc ('K') | « ui/wm/core/accelerator_filter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698