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
3 // found in the LICENSE file.
5 #include "ash/accelerators/accelerator_table.h"
7 #include "ash/strings/grit/ash_strings.h"
8 #include "base/basictypes.h"
12 const AcceleratorData kAcceleratorData
[] = {
13 // We have to define 3 entries for Shift+Alt. VKEY_[LR]MENU might be sent to
14 // the accelerator controller when RenderWidgetHostViewAura is focused, and
15 // VKEY_MENU might be when it's not (e.g. when NativeWidgetAura is focused).
16 { false, ui::VKEY_LMENU
, ui::EF_SHIFT_DOWN
, NEXT_IME
},
17 { false, ui::VKEY_MENU
, ui::EF_SHIFT_DOWN
, NEXT_IME
},
18 { false, ui::VKEY_RMENU
, ui::EF_SHIFT_DOWN
, NEXT_IME
},
19 // The same is true for Alt+Shift.
20 { false, ui::VKEY_LSHIFT
, ui::EF_ALT_DOWN
, NEXT_IME
},
21 { false, ui::VKEY_SHIFT
, ui::EF_ALT_DOWN
, NEXT_IME
},
22 { false, ui::VKEY_RSHIFT
, ui::EF_ALT_DOWN
, NEXT_IME
},
23 { true, ui::VKEY_SPACE
, ui::EF_CONTROL_DOWN
, PREVIOUS_IME
},
24 { false, ui::VKEY_SPACE
, ui::EF_CONTROL_DOWN
, PREVIOUS_IME
},
25 // Shortcuts for Japanese IME.
26 { true, ui::VKEY_CONVERT
, ui::EF_NONE
, SWITCH_IME
},
27 { true, ui::VKEY_NONCONVERT
, ui::EF_NONE
, SWITCH_IME
},
28 { true, ui::VKEY_DBE_SBCSCHAR
, ui::EF_NONE
, SWITCH_IME
},
29 { true, ui::VKEY_DBE_DBCSCHAR
, ui::EF_NONE
, SWITCH_IME
},
30 // Shortcut for Koren IME.
31 { true, ui::VKEY_HANGUL
, ui::EF_NONE
, SWITCH_IME
},
33 { true, ui::VKEY_TAB
, ui::EF_ALT_DOWN
, CYCLE_FORWARD_MRU
},
34 { true, ui::VKEY_TAB
, ui::EF_SHIFT_DOWN
| ui::EF_ALT_DOWN
,
36 { true, ui::VKEY_MEDIA_LAUNCH_APP1
, ui::EF_NONE
, TOGGLE_OVERVIEW
},
37 #if defined(OS_CHROMEOS)
38 { true, ui::VKEY_BROWSER_SEARCH
, ui::EF_NONE
, TOGGLE_APP_LIST
},
39 { true, ui::VKEY_WLAN
, ui::EF_NONE
, TOGGLE_WIFI
},
40 { true, ui::VKEY_KBD_BRIGHTNESS_DOWN
, ui::EF_NONE
, KEYBOARD_BRIGHTNESS_DOWN
},
41 { true, ui::VKEY_KBD_BRIGHTNESS_UP
, ui::EF_NONE
, KEYBOARD_BRIGHTNESS_UP
},
43 { true, ui::VKEY_MEDIA_LAUNCH_APP2
, ui::EF_CONTROL_DOWN
, TOGGLE_MIRROR_MODE
},
44 { true, ui::VKEY_MEDIA_LAUNCH_APP2
, ui::EF_ALT_DOWN
, SWAP_PRIMARY_DISPLAY
},
45 // Cycle windows button.
46 { true, ui::VKEY_MEDIA_LAUNCH_APP1
, ui::EF_CONTROL_DOWN
, TAKE_SCREENSHOT
},
47 { true, ui::VKEY_MEDIA_LAUNCH_APP1
, ui::EF_SHIFT_DOWN
| ui::EF_CONTROL_DOWN
,
48 TAKE_PARTIAL_SCREENSHOT
},
49 { true, ui::VKEY_BRIGHTNESS_DOWN
, ui::EF_NONE
, BRIGHTNESS_DOWN
},
50 { true, ui::VKEY_BRIGHTNESS_DOWN
, ui::EF_ALT_DOWN
, KEYBOARD_BRIGHTNESS_DOWN
},
51 { true, ui::VKEY_BRIGHTNESS_UP
, ui::EF_NONE
, BRIGHTNESS_UP
},
52 { true, ui::VKEY_BRIGHTNESS_UP
, ui::EF_ALT_DOWN
, KEYBOARD_BRIGHTNESS_UP
},
53 { true, ui::VKEY_BRIGHTNESS_DOWN
, ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
,
54 MAGNIFY_SCREEN_ZOOM_OUT
},
55 { true, ui::VKEY_BRIGHTNESS_UP
, ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
,
56 MAGNIFY_SCREEN_ZOOM_IN
},
57 { true, ui::VKEY_L
, ui::EF_COMMAND_DOWN
, LOCK_SCREEN
},
58 // The lock key on Chrome OS keyboards produces F13 scancodes.
59 { true, ui::VKEY_F13
, ui::EF_NONE
, LOCK_PRESSED
},
60 { false, ui::VKEY_F13
, ui::EF_NONE
, LOCK_RELEASED
},
61 // Generic keyboards can use VKEY_SLEEP to mimic ChromeOS keyboard's lock key.
62 { true, ui::VKEY_SLEEP
, ui::EF_NONE
, LOCK_PRESSED
},
63 { false, ui::VKEY_SLEEP
, ui::EF_NONE
, LOCK_RELEASED
},
64 { true, ui::VKEY_POWER
, ui::EF_NONE
, POWER_PRESSED
},
65 { false, ui::VKEY_POWER
, ui::EF_NONE
, POWER_RELEASED
},
66 { true, ui::VKEY_M
, ui::EF_SHIFT_DOWN
| ui::EF_ALT_DOWN
,
68 { true, ui::VKEY_OEM_2
, ui::EF_CONTROL_DOWN
, OPEN_GET_HELP
},
69 { true, ui::VKEY_OEM_2
, ui::EF_SHIFT_DOWN
| ui::EF_CONTROL_DOWN
,
71 { true, ui::VKEY_T
, ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
, OPEN_CROSH
},
72 { true, ui::VKEY_G
, ui::EF_SHIFT_DOWN
| ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
,
73 DISABLE_GPU_WATCHDOG
},
74 { true, ui::VKEY_I
, ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
,
75 TOUCH_HUD_MODE_CHANGE
},
76 { true, ui::VKEY_I
, ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
| ui::EF_SHIFT_DOWN
,
78 { true, ui::VKEY_P
, ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
,
79 TOUCH_HUD_PROJECTION_TOGGLE
},
80 // Accessibility: Spoken feedback shortcuts. The first one is to toggle
81 // spoken feedback on or off. The others are only valid when
82 // spoken feedback is enabled.
83 { true, ui::VKEY_Z
, ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
,
84 TOGGLE_SPOKEN_FEEDBACK
},
85 { true, ui::VKEY_CONTROL
, ui::EF_CONTROL_DOWN
, SILENCE_SPOKEN_FEEDBACK
},
86 { true, ui::VKEY_LCONTROL
, ui::EF_CONTROL_DOWN
, SILENCE_SPOKEN_FEEDBACK
},
87 { true, ui::VKEY_RCONTROL
, ui::EF_CONTROL_DOWN
, SILENCE_SPOKEN_FEEDBACK
},
88 { true, ui::VKEY_OEM_COMMA
, ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
,
89 SWITCH_TO_PREVIOUS_USER
},
90 { true, ui::VKEY_OEM_PERIOD
, ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
,
91 SWITCH_TO_NEXT_USER
},
92 // Turning the TouchView maximizing mode on via hotkey for the time being.
93 // TODO(skuhne): Remove once the test isn't needed anymore.
94 { true, ui::VKEY_8
, ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
| ui::EF_SHIFT_DOWN
,
95 TOGGLE_TOUCH_VIEW_TESTING
},
96 // Single shift release turns off caps lock.
97 { false, ui::VKEY_LSHIFT
, ui::EF_NONE
, DISABLE_CAPS_LOCK
},
98 { false, ui::VKEY_SHIFT
, ui::EF_NONE
, DISABLE_CAPS_LOCK
},
99 { false, ui::VKEY_RSHIFT
, ui::EF_NONE
, DISABLE_CAPS_LOCK
},
100 { false, ui::VKEY_LWIN
, ui::EF_ALT_DOWN
, TOGGLE_CAPS_LOCK
},
101 { true, ui::VKEY_VOLUME_MUTE
, ui::EF_NONE
, VOLUME_MUTE
},
102 { true, ui::VKEY_VOLUME_DOWN
, ui::EF_NONE
, VOLUME_DOWN
},
103 { true, ui::VKEY_VOLUME_UP
, ui::EF_NONE
, VOLUME_UP
},
104 { true, ui::VKEY_ESCAPE
, ui::EF_COMMAND_DOWN
, SHOW_TASK_MANAGER
},
105 #else // defined(OS_CHROMEOS)
106 // This key has been deprecated on CrOS. It is instead included below in the
107 // |kDeprecatedAccelerators|, and above in the CrOS accelerators as
109 { true, ui::VKEY_ESCAPE
, ui::EF_SHIFT_DOWN
, SHOW_TASK_MANAGER
},
110 #endif // defined(OS_CHROMEOS)
111 { true, ui::VKEY_I
, ui::EF_SHIFT_DOWN
| ui::EF_ALT_DOWN
, OPEN_FEEDBACK_PAGE
},
113 { true, ui::VKEY_Q
, ui::EF_SHIFT_DOWN
| ui::EF_CONTROL_DOWN
, EXIT
},
115 { true, ui::VKEY_N
, ui::EF_SHIFT_DOWN
| ui::EF_CONTROL_DOWN
,
116 NEW_INCOGNITO_WINDOW
},
117 { true, ui::VKEY_N
, ui::EF_CONTROL_DOWN
, NEW_WINDOW
},
118 { true, ui::VKEY_T
, ui::EF_CONTROL_DOWN
, NEW_TAB
},
119 { true, ui::VKEY_OEM_MINUS
,
120 ui::EF_CONTROL_DOWN
| ui::EF_SHIFT_DOWN
, SCALE_UI_UP
},
121 { true, ui::VKEY_OEM_PLUS
,
122 ui::EF_CONTROL_DOWN
| ui::EF_SHIFT_DOWN
, SCALE_UI_DOWN
},
124 ui::EF_CONTROL_DOWN
| ui::EF_SHIFT_DOWN
, SCALE_UI_RESET
},
125 { true, ui::VKEY_BROWSER_REFRESH
,
126 ui::EF_CONTROL_DOWN
| ui::EF_SHIFT_DOWN
, ROTATE_SCREEN
},
127 { true, ui::VKEY_BROWSER_REFRESH
,
128 ui::EF_SHIFT_DOWN
| ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
,
130 { true, ui::VKEY_T
, ui::EF_SHIFT_DOWN
| ui::EF_CONTROL_DOWN
, RESTORE_TAB
},
131 { true, ui::VKEY_PRINT
, ui::EF_NONE
, TAKE_SCREENSHOT
},
132 // On Chrome OS, Search key is mapped to LWIN. The Search key binding should
133 // act on release instead of press when using Search as a modifier key for
134 // extended keyboard shortcuts.
135 { false, ui::VKEY_LWIN
, ui::EF_NONE
, TOGGLE_APP_LIST
},
136 { true, ui::VKEY_MEDIA_LAUNCH_APP2
, ui::EF_NONE
, TOGGLE_FULLSCREEN
},
137 { true, ui::VKEY_MEDIA_LAUNCH_APP2
, ui::EF_SHIFT_DOWN
, TOGGLE_FULLSCREEN
},
138 { true, ui::VKEY_L
, ui::EF_SHIFT_DOWN
| ui::EF_ALT_DOWN
, FOCUS_SHELF
},
139 { true, ui::VKEY_HELP
, ui::EF_NONE
, SHOW_KEYBOARD_OVERLAY
},
140 { true, ui::VKEY_OEM_2
, ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
,
141 SHOW_KEYBOARD_OVERLAY
},
142 { true, ui::VKEY_OEM_2
,
143 ui::EF_SHIFT_DOWN
| ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
,
144 SHOW_KEYBOARD_OVERLAY
},
145 { true, ui::VKEY_F14
, ui::EF_NONE
, SHOW_KEYBOARD_OVERLAY
},
146 { true, ui::VKEY_N
, ui::EF_SHIFT_DOWN
| ui::EF_ALT_DOWN
,
147 SHOW_MESSAGE_CENTER_BUBBLE
},
148 { true, ui::VKEY_S
, ui::EF_SHIFT_DOWN
| ui::EF_ALT_DOWN
,
149 SHOW_SYSTEM_TRAY_BUBBLE
},
150 { true, ui::VKEY_1
, ui::EF_ALT_DOWN
, LAUNCH_APP_0
},
151 { true, ui::VKEY_2
, ui::EF_ALT_DOWN
, LAUNCH_APP_1
},
152 { true, ui::VKEY_3
, ui::EF_ALT_DOWN
, LAUNCH_APP_2
},
153 { true, ui::VKEY_4
, ui::EF_ALT_DOWN
, LAUNCH_APP_3
},
154 { true, ui::VKEY_5
, ui::EF_ALT_DOWN
, LAUNCH_APP_4
},
155 { true, ui::VKEY_6
, ui::EF_ALT_DOWN
, LAUNCH_APP_5
},
156 { true, ui::VKEY_7
, ui::EF_ALT_DOWN
, LAUNCH_APP_6
},
157 { true, ui::VKEY_8
, ui::EF_ALT_DOWN
, LAUNCH_APP_7
},
158 { true, ui::VKEY_9
, ui::EF_ALT_DOWN
, LAUNCH_LAST_APP
},
160 // Window management shortcuts.
161 { true, ui::VKEY_OEM_4
, ui::EF_ALT_DOWN
, WINDOW_CYCLE_SNAP_DOCK_LEFT
},
162 { true, ui::VKEY_OEM_6
, ui::EF_ALT_DOWN
, WINDOW_CYCLE_SNAP_DOCK_RIGHT
},
163 { true, ui::VKEY_OEM_MINUS
, ui::EF_ALT_DOWN
, WINDOW_MINIMIZE
},
164 { true, ui::VKEY_OEM_PLUS
, ui::EF_ALT_DOWN
, TOGGLE_MAXIMIZED
},
165 { true, ui::VKEY_OEM_PLUS
, ui::EF_SHIFT_DOWN
| ui::EF_ALT_DOWN
,
166 WINDOW_POSITION_CENTER
},
167 { true, ui::VKEY_BROWSER_FORWARD
, ui::EF_CONTROL_DOWN
, FOCUS_NEXT_PANE
},
168 { true, ui::VKEY_BROWSER_BACK
, ui::EF_CONTROL_DOWN
, FOCUS_PREVIOUS_PANE
},
170 // Media Player shortcuts.
171 { true, ui::VKEY_MEDIA_NEXT_TRACK
, ui::EF_NONE
, MEDIA_NEXT_TRACK
},
172 { true, ui::VKEY_MEDIA_PLAY_PAUSE
, ui::EF_NONE
, MEDIA_PLAY_PAUSE
},
173 { true, ui::VKEY_MEDIA_PREV_TRACK
, ui::EF_NONE
, MEDIA_PREV_TRACK
},
175 // Debugging shortcuts that need to be available to end-users in
177 { true, ui::VKEY_U
, ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
| ui::EF_SHIFT_DOWN
,
178 PRINT_UI_HIERARCHIES
},
180 { false, ui::VKEY_HOME
, ui::EF_SHIFT_DOWN
, ACCESSIBLE_FOCUS_PREVIOUS
},
181 { false, ui::VKEY_PRIOR
, ui::EF_SHIFT_DOWN
, ACCESSIBLE_FOCUS_PREVIOUS
},
182 { false, ui::VKEY_END
, ui::EF_SHIFT_DOWN
, ACCESSIBLE_FOCUS_NEXT
},
183 { false, ui::VKEY_NEXT
, ui::EF_SHIFT_DOWN
, ACCESSIBLE_FOCUS_NEXT
},
185 // TODO(yusukes): Handle VKEY_MEDIA_STOP, and
186 // VKEY_MEDIA_LAUNCH_MAIL.
189 const size_t kAcceleratorDataLength
= arraysize(kAcceleratorData
);
191 // Instructions for how to deprecate and replace an Accelerator:
193 // 1- Replace the old deprecated accelerator from the above list with the new
194 // accelerator that will take its place.
195 // 2- Add an entry for it in the following |kDeprecatedAccelerators| list.
196 // 3- That entry should contain the following:
197 // - The deprecated accelerator data you removed from above.
198 // - Define a histogram for this action in |histograms.xml| in the form
199 // "Ash.Accelerators.{ActionName}" and include the name of this histogram
201 // - The ID of the localized notification message to give the users telling
202 // them about the deprecation (Add one in |ash_chromeos_strings.grdp|.
203 // Search for the comment <!-- Deprecated Accelerators Messages -->).
204 // - {true or false} whether the deprecated accelerator is still enabled (we
205 // don't disable a deprecated accelerator abruptly).
206 // 4- Don't forget to update the keyboard overlay.
207 #if defined(OS_CHROMEOS)
209 const DeprecatedAcceleratorData kDeprecatedAccelerators
[] = {
211 { true, ui::VKEY_L
, ui::EF_SHIFT_DOWN
| ui::EF_CONTROL_DOWN
, LOCK_SCREEN
},
212 "Ash.Accelerators.LockScreen",
213 IDS_DEPRECATED_LOCK_SCREEN_MSG
,
217 { true, ui::VKEY_ESCAPE
, ui::EF_SHIFT_DOWN
, SHOW_TASK_MANAGER
},
218 "Ash.Accelerators.ShowTaskManager",
219 IDS_DEPRECATED_SHOW_TASK_MANAGER_MSG
,
224 const size_t kDeprecatedAcceleratorsLength
= arraysize(kDeprecatedAccelerators
);
226 #endif // defined(OS_CHROMEOS)
228 const AcceleratorData kDebugAcceleratorData
[] = {
229 #if defined(OS_CHROMEOS)
230 // Extra shortcut for debug build to control magnifier on linux desktop.
231 { true, ui::VKEY_BRIGHTNESS_DOWN
, ui::EF_CONTROL_DOWN
,
232 MAGNIFY_SCREEN_ZOOM_OUT
},
233 { true, ui::VKEY_BRIGHTNESS_UP
, ui::EF_CONTROL_DOWN
, MAGNIFY_SCREEN_ZOOM_IN
},
234 // Extra shortcuts to lock the screen on linux desktop.
235 { true, ui::VKEY_L
, ui::EF_ALT_DOWN
, LOCK_SCREEN
},
236 { true, ui::VKEY_POWER
, ui::EF_SHIFT_DOWN
, LOCK_PRESSED
},
237 { false, ui::VKEY_POWER
, ui::EF_SHIFT_DOWN
, LOCK_RELEASED
},
238 { true, ui::VKEY_D
, ui::EF_CONTROL_DOWN
| ui::EF_SHIFT_DOWN
,
239 DEBUG_ADD_REMOVE_DISPLAY
},
240 { true, ui::VKEY_M
, ui::EF_CONTROL_DOWN
| ui::EF_SHIFT_DOWN
,
241 TOGGLE_MIRROR_MODE
},
242 { true, ui::VKEY_W
, ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
, TOGGLE_WIFI
},
243 // Extra shortcut for display swapping as alt-f4 is taken on linux desktop.
244 { true, ui::VKEY_S
, ui::EF_SHIFT_DOWN
| ui::EF_CONTROL_DOWN
,
245 SWAP_PRIMARY_DISPLAY
},
247 // Extra shortcut to rotate/scale up/down the screen on linux desktop.
249 ui::EF_SHIFT_DOWN
| ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
, ROTATE_SCREEN
},
250 // For testing on systems where Alt-Tab is already mapped.
251 { true, ui::VKEY_W
, ui::EF_ALT_DOWN
, CYCLE_FORWARD_MRU
},
252 { true, ui::VKEY_F11
, ui::EF_CONTROL_DOWN
,
253 DEBUG_TOGGLE_ROOT_WINDOW_FULL_SCREEN
},
254 { true, ui::VKEY_W
, ui::EF_SHIFT_DOWN
| ui::EF_ALT_DOWN
,
255 CYCLE_BACKWARD_MRU
},
256 { true, ui::VKEY_B
, ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
,
257 DEBUG_TOGGLE_DESKTOP_BACKGROUND_MODE
},
258 { true, ui::VKEY_F
, ui::EF_SHIFT_DOWN
| ui::EF_CONTROL_DOWN
,
260 { true, ui::VKEY_L
, ui::EF_SHIFT_DOWN
| ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
,
261 DEBUG_PRINT_LAYER_HIERARCHY
},
262 { true, ui::VKEY_V
, ui::EF_SHIFT_DOWN
| ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
,
263 DEBUG_PRINT_VIEW_HIERARCHY
},
264 { true, ui::VKEY_W
, ui::EF_SHIFT_DOWN
| ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
,
265 DEBUG_PRINT_WINDOW_HIERARCHY
},
266 { true, ui::VKEY_S
, ui::EF_SHIFT_DOWN
| ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
,
267 DEBUG_TOGGLE_DEVICE_SCALE_FACTOR
},
268 { true, ui::VKEY_B
, ui::EF_SHIFT_DOWN
| ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
,
269 DEBUG_TOGGLE_SHOW_DEBUG_BORDERS
},
270 { true, ui::VKEY_F
, ui::EF_SHIFT_DOWN
| ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
,
271 DEBUG_TOGGLE_SHOW_FPS_COUNTER
},
272 { true, ui::VKEY_P
, ui::EF_SHIFT_DOWN
| ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
,
273 DEBUG_TOGGLE_SHOW_PAINT_RECTS
},
276 const size_t kDebugAcceleratorDataLength
= arraysize(kDebugAcceleratorData
);
278 const AcceleratorAction kPreferredActions
[] = {
279 // Window cycling accelerators.
280 CYCLE_BACKWARD_MRU
, // Shift+Alt+Tab
281 CYCLE_FORWARD_MRU
, // Alt+Tab
284 const size_t kPreferredActionsLength
= arraysize(kPreferredActions
);
286 const AcceleratorAction kReservedActions
[] = {
287 #if defined(OS_CHROMEOS)
295 const size_t kReservedActionsLength
= arraysize(kReservedActions
);
297 const AcceleratorAction kActionsAllowedAtLoginOrLockScreen
[] = {
298 DEBUG_PRINT_LAYER_HIERARCHY
,
299 DEBUG_PRINT_VIEW_HIERARCHY
,
300 DEBUG_PRINT_WINDOW_HIERARCHY
,
301 MAGNIFY_SCREEN_ZOOM_IN
, // Control+F7
302 MAGNIFY_SCREEN_ZOOM_OUT
, // Control+F6
305 PRINT_UI_HIERARCHIES
,
307 SHOW_SYSTEM_TRAY_BUBBLE
,
308 SWITCH_IME
, // Switch to another IME depending on the accelerator.
309 TAKE_PARTIAL_SCREENSHOT
,
311 #if defined(OS_CHROMEOS)
314 DEBUG_ADD_REMOVE_DISPLAY
,
316 DISABLE_GPU_WATCHDOG
,
317 KEYBOARD_BRIGHTNESS_DOWN
,
318 KEYBOARD_BRIGHTNESS_UP
,
320 TOGGLE_SPOKEN_FEEDBACK
,
321 TOGGLE_TOUCH_VIEW_TESTING
,
329 #if defined(OS_CHROMEOS) && !defined(NDEBUG)
332 #endif // defined(OS_CHROMEOS)
335 const size_t kActionsAllowedAtLoginOrLockScreenLength
=
336 arraysize(kActionsAllowedAtLoginOrLockScreen
);
338 const AcceleratorAction kActionsAllowedAtLockScreen
[] = {
342 const size_t kActionsAllowedAtLockScreenLength
=
343 arraysize(kActionsAllowedAtLockScreen
);
345 const AcceleratorAction kActionsAllowedAtModalWindow
[] = {
347 MAGNIFY_SCREEN_ZOOM_IN
,
348 MAGNIFY_SCREEN_ZOOM_OUT
,
355 PRINT_UI_HIERARCHIES
,
360 SHOW_KEYBOARD_OVERLAY
,
362 TAKE_PARTIAL_SCREENSHOT
,
364 #if defined(OS_CHROMEOS)
367 DEBUG_ADD_REMOVE_DISPLAY
,
369 KEYBOARD_BRIGHTNESS_DOWN
,
370 KEYBOARD_BRIGHTNESS_UP
,
374 SWAP_PRIMARY_DISPLAY
,
377 TOGGLE_SPOKEN_FEEDBACK
,
385 const size_t kActionsAllowedAtModalWindowLength
=
386 arraysize(kActionsAllowedAtModalWindow
);
388 const AcceleratorAction kNonrepeatableActions
[] = {
389 // TODO(mazda): Add other actions which should not be repeated.
394 PRINT_UI_HIERARCHIES
, // Don't fill the logs if the key is held down.
403 #if defined(OS_CHROMEOS)
408 const size_t kNonrepeatableActionsLength
=
409 arraysize(kNonrepeatableActions
);
411 const AcceleratorAction kActionsAllowedInAppMode
[] = {
412 DEBUG_PRINT_LAYER_HIERARCHY
,
413 DEBUG_PRINT_VIEW_HIERARCHY
,
414 DEBUG_PRINT_WINDOW_HIERARCHY
,
415 MAGNIFY_SCREEN_ZOOM_IN
, // Control+F7
416 MAGNIFY_SCREEN_ZOOM_OUT
, // Control+F6
422 PRINT_UI_HIERARCHIES
,
427 SWITCH_IME
, // Switch to another IME depending on the accelerator.
428 #if defined(OS_CHROMEOS)
431 DEBUG_ADD_REMOVE_DISPLAY
,
433 DISABLE_GPU_WATCHDOG
,
434 KEYBOARD_BRIGHTNESS_DOWN
,
435 KEYBOARD_BRIGHTNESS_UP
,
438 SWAP_PRIMARY_DISPLAY
,
441 TOGGLE_SPOKEN_FEEDBACK
,
447 #endif // defined(OS_CHROMEOS)
450 const size_t kActionsAllowedInAppModeLength
=
451 arraysize(kActionsAllowedInAppMode
);
453 const AcceleratorAction kActionsNeedingWindow
[] = {
454 ACCESSIBLE_FOCUS_NEXT
,
455 ACCESSIBLE_FOCUS_PREVIOUS
,
459 WINDOW_CYCLE_SNAP_DOCK_LEFT
,
460 WINDOW_CYCLE_SNAP_DOCK_RIGHT
,
464 WINDOW_POSITION_CENTER
,
468 const size_t kActionsNeedingWindowLength
= arraysize(kActionsNeedingWindow
);