Index: ash/accelerators/accelerator_controller.cc |
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc |
index f6199cc4e3024597da006da8b2c15bc9c4db337e..95255a58614cb160ca674cc59d701aa192b886a5 100644 |
--- a/ash/accelerators/accelerator_controller.cc |
+++ b/ash/accelerators/accelerator_controller.cc |
@@ -534,6 +534,30 @@ bool AcceleratorController::PerformAction(int action, |
// this key combination is reserved for partial screenshot. |
return true; |
case TOGGLE_APP_LIST: |
+ if (accelerator.key_code() == ui::VKEY_LWIN) { |
+ // For bindings on the Search key, activate the binding on press if the |
+ // Search key is not acting as a modifier. Otherwise, activate it on |
+ // release. |
+ |
+ bool search_as_function_key = |
+ Shell::GetInstance()->delegate()->IsSearchKeyActingAsFunctionKey(); |
+ bool type_pressed = accelerator.type() == ui::ET_KEY_PRESSED; |
+ |
+ if (!search_as_function_key && !type_pressed) |
+ return false; |
+ if (search_as_function_key && type_pressed) |
+ return false; |
+ if (search_as_function_key && |
+ // See: case NEXT_IME. |
+ (previous_event_type == ui::ET_KEY_RELEASED || |
+ // If something else was pressed between the Search key (LWIN) |
+ // being pressed and released, then ignore the release of the |
+ // Search key. |
+ (accelerator.type() == ui::ET_KEY_RELEASED && |
+ context_.previous_accelerator().key_code() != ui::VKEY_LWIN))) { |
Yusuke Sato
2012/11/27 01:04:38
nit: previous_key_code != ui::VKEY_LWIN
danakj
2012/11/27 01:44:32
Done.
|
+ return false; |
+ } |
+ } |
if (key_code == ui::VKEY_LWIN && shell->delegate()) |
shell->delegate()->RecordUserMetricsAction(UMA_ACCEL_SEARCH_LWIN); |
// When spoken feedback is enabled, we should neither toggle the list nor |