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
},
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 // TODO(yusukes): Handle VKEY_MEDIA_STOP, and
181 // VKEY_MEDIA_LAUNCH_MAIL.
184 const size_t kAcceleratorDataLength
= arraysize(kAcceleratorData
);
186 // Instructions for how to deprecate and replace an Accelerator:
188 // 1- Replace the old deprecated accelerator from the above list with the new
189 // accelerator that will take its place.
190 // 2- Add an entry for it in the following |kDeprecatedAccelerators| list.
191 // 3- That entry should contain the following:
192 // - The deprecated accelerator data you removed from above.
193 // - Define a histogram for this action in |histograms.xml| in the form
194 // "Ash.Accelerators.Deprecated.{ActionName}" and include the name of this
195 // histogram in this entry. This name will be used as the ID of the
196 // notification to be shown to the user. This is to prevent duplication of
197 // same notification.
198 // - The ID of the localized notification message to give the users telling
199 // them about the deprecation (Add one in |ash_chromeos_strings.grdp|.
200 // Search for the comment <!-- Deprecated Accelerators Messages -->).
201 // - {true or false} whether the deprecated accelerator is still enabled (we
202 // don't disable a deprecated accelerator abruptly).
203 // 4- Don't forget to update the keyboard overlay.
204 #if defined(OS_CHROMEOS)
206 const DeprecatedAcceleratorData kDeprecatedAccelerators
[] = {
208 { true, ui::VKEY_L
, ui::EF_SHIFT_DOWN
| ui::EF_CONTROL_DOWN
, LOCK_SCREEN
},
209 "Ash.Accelerators.Deprecated.LockScreen",
210 IDS_DEPRECATED_LOCK_SCREEN_MSG
,
214 { true, ui::VKEY_ESCAPE
, ui::EF_SHIFT_DOWN
, SHOW_TASK_MANAGER
},
215 "Ash.Accelerators.Deprecated.ShowTaskManager",
216 IDS_DEPRECATED_SHOW_TASK_MANAGER_MSG
,
221 const size_t kDeprecatedAcceleratorsLength
= arraysize(kDeprecatedAccelerators
);
223 #endif // defined(OS_CHROMEOS)
225 const AcceleratorData kDebugAcceleratorData
[] = {
226 #if defined(OS_CHROMEOS)
227 // Extra shortcut for debug build to control magnifier on linux desktop.
228 {true, ui::VKEY_BRIGHTNESS_DOWN
, ui::EF_CONTROL_DOWN
,
229 MAGNIFY_SCREEN_ZOOM_OUT
},
230 {true, ui::VKEY_BRIGHTNESS_UP
, ui::EF_CONTROL_DOWN
, MAGNIFY_SCREEN_ZOOM_IN
},
231 // Extra shortcuts to lock the screen on linux desktop.
232 {true, ui::VKEY_L
, ui::EF_ALT_DOWN
, LOCK_SCREEN
},
233 {true, ui::VKEY_POWER
, ui::EF_SHIFT_DOWN
, LOCK_PRESSED
},
234 {false, ui::VKEY_POWER
, ui::EF_SHIFT_DOWN
, LOCK_RELEASED
},
235 {true, ui::VKEY_D
, ui::EF_CONTROL_DOWN
| ui::EF_SHIFT_DOWN
,
236 DEBUG_ADD_REMOVE_DISPLAY
},
237 {true, ui::VKEY_J
, ui::EF_CONTROL_DOWN
| ui::EF_SHIFT_DOWN
,
238 DEBUG_TOGGLE_UNIFIED_DESKTOP
},
239 {true, ui::VKEY_M
, ui::EF_CONTROL_DOWN
| ui::EF_SHIFT_DOWN
,
241 {true, ui::VKEY_W
, ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
, TOGGLE_WIFI
},
242 // Extra shortcut for display swapping as alt-f4 is taken on linux desktop.
243 {true, ui::VKEY_S
, ui::EF_SHIFT_DOWN
| ui::EF_CONTROL_DOWN
,
244 SWAP_PRIMARY_DISPLAY
},
246 // Extra shortcut to rotate/scale up/down the screen on linux desktop.
248 ui::EF_SHIFT_DOWN
| ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
, ROTATE_SCREEN
},
249 // For testing on systems where Alt-Tab is already mapped.
250 {true, ui::VKEY_W
, ui::EF_ALT_DOWN
, CYCLE_FORWARD_MRU
},
251 {true, ui::VKEY_F11
, ui::EF_CONTROL_DOWN
,
252 DEBUG_TOGGLE_ROOT_WINDOW_FULL_SCREEN
},
253 {true, ui::VKEY_W
, ui::EF_SHIFT_DOWN
| ui::EF_ALT_DOWN
, CYCLE_BACKWARD_MRU
},
254 {true, ui::VKEY_B
, ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
,
255 DEBUG_TOGGLE_DESKTOP_BACKGROUND_MODE
},
256 {true, ui::VKEY_F
, ui::EF_SHIFT_DOWN
| ui::EF_CONTROL_DOWN
,
259 ui::EF_SHIFT_DOWN
| ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
,
260 DEBUG_PRINT_LAYER_HIERARCHY
},
262 ui::EF_SHIFT_DOWN
| ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
,
263 DEBUG_PRINT_VIEW_HIERARCHY
},
265 ui::EF_SHIFT_DOWN
| ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
,
266 DEBUG_PRINT_WINDOW_HIERARCHY
},
268 ui::EF_SHIFT_DOWN
| ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
,
269 DEBUG_TOGGLE_DEVICE_SCALE_FACTOR
},
271 ui::EF_SHIFT_DOWN
| ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
,
272 DEBUG_TOGGLE_SHOW_DEBUG_BORDERS
},
274 ui::EF_SHIFT_DOWN
| ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
,
275 DEBUG_TOGGLE_SHOW_FPS_COUNTER
},
277 ui::EF_SHIFT_DOWN
| ui::EF_CONTROL_DOWN
| ui::EF_ALT_DOWN
,
278 DEBUG_TOGGLE_SHOW_PAINT_RECTS
},
281 const size_t kDebugAcceleratorDataLength
= arraysize(kDebugAcceleratorData
);
283 const AcceleratorAction kPreferredActions
[] = {
284 // Window cycling accelerators.
285 CYCLE_BACKWARD_MRU
, // Shift+Alt+Tab
286 CYCLE_FORWARD_MRU
, // Alt+Tab
289 const size_t kPreferredActionsLength
= arraysize(kPreferredActions
);
291 const AcceleratorAction kReservedActions
[] = {
292 #if defined(OS_CHROMEOS)
300 const size_t kReservedActionsLength
= arraysize(kReservedActions
);
302 const AcceleratorAction kActionsAllowedAtLoginOrLockScreen
[] = {
303 DEBUG_PRINT_LAYER_HIERARCHY
,
304 DEBUG_PRINT_VIEW_HIERARCHY
,
305 DEBUG_PRINT_WINDOW_HIERARCHY
,
306 MAGNIFY_SCREEN_ZOOM_IN
, // Control+F7
307 MAGNIFY_SCREEN_ZOOM_OUT
, // Control+F6
310 PRINT_UI_HIERARCHIES
,
315 SHOW_SYSTEM_TRAY_BUBBLE
,
316 SWITCH_IME
, // Switch to another IME depending on the accelerator.
317 TAKE_PARTIAL_SCREENSHOT
,
319 #if defined(OS_CHROMEOS)
322 DEBUG_ADD_REMOVE_DISPLAY
,
324 DISABLE_GPU_WATCHDOG
,
325 KEYBOARD_BRIGHTNESS_DOWN
,
326 KEYBOARD_BRIGHTNESS_UP
,
328 TOGGLE_SPOKEN_FEEDBACK
,
329 TOGGLE_TOUCH_VIEW_TESTING
,
337 #if defined(OS_CHROMEOS) && !defined(NDEBUG)
340 #endif // defined(OS_CHROMEOS)
343 const size_t kActionsAllowedAtLoginOrLockScreenLength
=
344 arraysize(kActionsAllowedAtLoginOrLockScreen
);
346 const AcceleratorAction kActionsAllowedAtLockScreen
[] = {
350 const size_t kActionsAllowedAtLockScreenLength
=
351 arraysize(kActionsAllowedAtLockScreen
);
353 const AcceleratorAction kActionsAllowedAtModalWindow
[] = {
355 MAGNIFY_SCREEN_ZOOM_IN
,
356 MAGNIFY_SCREEN_ZOOM_OUT
,
363 PRINT_UI_HIERARCHIES
,
368 SHOW_KEYBOARD_OVERLAY
,
370 TAKE_PARTIAL_SCREENSHOT
,
372 #if defined(OS_CHROMEOS)
375 DEBUG_ADD_REMOVE_DISPLAY
,
377 KEYBOARD_BRIGHTNESS_DOWN
,
378 KEYBOARD_BRIGHTNESS_UP
,
382 SWAP_PRIMARY_DISPLAY
,
385 TOGGLE_SPOKEN_FEEDBACK
,
393 const size_t kActionsAllowedAtModalWindowLength
=
394 arraysize(kActionsAllowedAtModalWindow
);
396 const AcceleratorAction kNonrepeatableActions
[] = {
397 // TODO(mazda): Add other actions which should not be repeated.
402 PRINT_UI_HIERARCHIES
, // Don't fill the logs if the key is held down.
408 TAKE_PARTIAL_SCREENSHOT
,
413 #if defined(OS_CHROMEOS)
418 const size_t kNonrepeatableActionsLength
=
419 arraysize(kNonrepeatableActions
);
421 const AcceleratorAction kActionsAllowedInAppMode
[] = {
422 DEBUG_PRINT_LAYER_HIERARCHY
,
423 DEBUG_PRINT_VIEW_HIERARCHY
,
424 DEBUG_PRINT_WINDOW_HIERARCHY
,
425 MAGNIFY_SCREEN_ZOOM_IN
, // Control+F7
426 MAGNIFY_SCREEN_ZOOM_OUT
, // Control+F6
432 PRINT_UI_HIERARCHIES
,
437 SWITCH_IME
, // Switch to another IME depending on the accelerator.
438 #if defined(OS_CHROMEOS)
441 DEBUG_ADD_REMOVE_DISPLAY
,
443 DISABLE_GPU_WATCHDOG
,
444 KEYBOARD_BRIGHTNESS_DOWN
,
445 KEYBOARD_BRIGHTNESS_UP
,
448 SWAP_PRIMARY_DISPLAY
,
451 TOGGLE_SPOKEN_FEEDBACK
,
457 #endif // defined(OS_CHROMEOS)
460 const size_t kActionsAllowedInAppModeLength
=
461 arraysize(kActionsAllowedInAppMode
);
463 const AcceleratorAction kActionsNeedingWindow
[] = {
467 WINDOW_CYCLE_SNAP_DOCK_LEFT
,
468 WINDOW_CYCLE_SNAP_DOCK_RIGHT
,
472 WINDOW_POSITION_CENTER
,
476 const size_t kActionsNeedingWindowLength
= arraysize(kActionsNeedingWindow
);
478 const AcceleratorAction kActionsKeepingMenuOpen
[] = {
484 PRINT_UI_HIERARCHIES
,
486 TAKE_PARTIAL_SCREENSHOT
,
488 #if defined(OS_CHROMEOS)
492 KEYBOARD_BRIGHTNESS_DOWN
,
493 KEYBOARD_BRIGHTNESS_UP
,
494 SILENCE_SPOKEN_FEEDBACK
,
496 TOGGLE_SPOKEN_FEEDBACK
,
501 #endif // defined(OS_CHROMEOS)
504 const size_t kActionsKeepingMenuOpenLength
= arraysize(kActionsKeepingMenuOpen
);