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

Side by Side Diff: chrome/browser/chromeos/system_key_event_listener.cc

Issue 9784001: Merge 123866 - Ignore Shift+Search when spoken feedback is enabled (non-Aura). (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1025_118/src/
Patch Set: Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/chromeos/system_key_event_listener.h" 5 #include "chrome/browser/chromeos/system_key_event_listener.h"
6 6
7 #define XK_MISCELLANY 1 7 #define XK_MISCELLANY 1
8 #include <X11/keysymdef.h> 8 #include <X11/keysymdef.h>
9 #include <X11/XF86keysym.h> 9 #include <X11/XF86keysym.h>
10 #include <X11/XKBlib.h> 10 #include <X11/XKBlib.h>
11 #undef Status 11 #undef Status
12 12
13 #include "chrome/browser/chromeos/accessibility/accessibility_util.h"
13 #include "chrome/browser/chromeos/audio/audio_handler.h" 14 #include "chrome/browser/chromeos/audio/audio_handler.h"
14 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" 15 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h"
15 #include "chrome/browser/chromeos/dbus/power_manager_client.h" 16 #include "chrome/browser/chromeos/dbus/power_manager_client.h"
16 #include "chrome/browser/chromeos/input_method/hotkey_manager.h" 17 #include "chrome/browser/chromeos/input_method/hotkey_manager.h"
17 #include "chrome/browser/chromeos/input_method/input_method_manager.h" 18 #include "chrome/browser/chromeos/input_method/input_method_manager.h"
18 #include "chrome/browser/chromeos/input_method/xkeyboard.h" 19 #include "chrome/browser/chromeos/input_method/xkeyboard.h"
19 #include "chrome/browser/chromeos/ui/brightness_bubble.h" 20 #include "chrome/browser/chromeos/ui/brightness_bubble.h"
20 #include "chrome/browser/chromeos/ui/volume_bubble.h" 21 #include "chrome/browser/chromeos/ui/volume_bubble.h"
21 #include "chrome/browser/extensions/system/system_api.h" 22 #include "chrome/browser/extensions/system/system_api.h"
22 #include "content/public/browser/user_metrics.h" 23 #include "content/public/browser/user_metrics.h"
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 const int32 keycode = xevent->xkey.keycode; 336 const int32 keycode = xevent->xkey.keycode;
336 if (keycode) { 337 if (keycode) {
337 const unsigned int state = (xevent->xkey.state & kSupportedModifiers); 338 const unsigned int state = (xevent->xkey.state & kSupportedModifiers);
338 339
339 #if !defined(USE_AURA) 340 #if !defined(USE_AURA)
340 // Toggle Caps Lock if Shift and Search keys are pressed. 341 // Toggle Caps Lock if Shift and Search keys are pressed.
341 // When Aura is in use, the shortcut is handled in Ash. 342 // When Aura is in use, the shortcut is handled in Ash.
342 if (XKeycodeToKeysym(ui::GetXDisplay(), keycode, 0) == XK_Super_L) { 343 if (XKeycodeToKeysym(ui::GetXDisplay(), keycode, 0) == XK_Super_L) {
343 const bool shift_is_held = (state & ShiftMask); 344 const bool shift_is_held = (state & ShiftMask);
344 const bool other_mods_are_held = (state & ~(ShiftMask | LockMask)); 345 const bool other_mods_are_held = (state & ~(ShiftMask | LockMask));
345 if (shift_is_held && !other_mods_are_held) 346
347 // When spoken feedback is enabled, the Search key is used as an
348 // accessibility modifier key.
349 const bool accessibility_enabled =
350 accessibility::IsAccessibilityEnabled();
351
352 if (shift_is_held && !other_mods_are_held && !accessibility_enabled) {
346 input_method_manager->GetXKeyboard()->SetCapsLockEnabled( 353 input_method_manager->GetXKeyboard()->SetCapsLockEnabled(
347 !caps_lock_is_on_); 354 !caps_lock_is_on_);
355 }
348 } 356 }
349 #endif 357 #endif
350 358
351 // Only doing non-Alt/Shift/Ctrl modified keys 359 // Only doing non-Alt/Shift/Ctrl modified keys
352 if (!(state & (Mod1Mask | ShiftMask | ControlMask))) { 360 if (!(state & (Mod1Mask | ShiftMask | ControlMask))) {
353 if (keycode == key_f6_ || keycode == key_brightness_down_) { 361 if (keycode == key_f6_ || keycode == key_brightness_down_) {
354 if (keycode == key_f6_) 362 if (keycode == key_f6_)
355 content::RecordAction( 363 content::RecordAction(
356 UserMetricsAction("Accel_BrightnessDown_F6")); 364 UserMetricsAction("Accel_BrightnessDown_F6"));
357 OnBrightnessDown(); 365 OnBrightnessDown();
(...skipping 20 matching lines...) Expand all
378 OnVolumeUp(); 386 OnVolumeUp();
379 return true; 387 return true;
380 } 388 }
381 } 389 }
382 } 390 }
383 } 391 }
384 return false; 392 return false;
385 } 393 }
386 394
387 } // namespace chromeos 395 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698