Reland "Non-SFI mode: Switch to newlib. (patchset #4 id:60001 of https://codereview...
[chromium-blink-merge.git] / ash / accelerators / accelerator_table.cc
blob79301915d61d480a997176fc10624d570b252aa1
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"
10 namespace ash {
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,
35 CYCLE_BACKWARD_MRU },
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 },
42 // Maximize button.
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,
67 OPEN_FILE_MANAGER },
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,
70 OPEN_GET_HELP },
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,
77 TOUCH_HUD_CLEAR },
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
108 // Search+Esc.
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 },
112 #if !defined(OS_WIN)
113 { true, ui::VKEY_Q, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, EXIT },
114 #endif
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 },
123 { true, ui::VKEY_0,
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,
129 ROTATE_WINDOW },
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
176 // release builds.
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
200 // in this entry.
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,
214 true
217 { true, ui::VKEY_ESCAPE, ui::EF_SHIFT_DOWN, SHOW_TASK_MANAGER },
218 "Ash.Accelerators.ShowTaskManager",
219 IDS_DEPRECATED_SHOW_TASK_MANAGER_MSG,
220 true
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 },
246 #endif
247 // Extra shortcut to rotate/scale up/down the screen on linux desktop.
248 { true, ui::VKEY_R,
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,
259 TOGGLE_FULLSCREEN },
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)
288 POWER_PRESSED,
289 POWER_RELEASED,
290 #else
291 DUMMY_FOR_RESERVED,
292 #endif
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
303 NEXT_IME,
304 PREVIOUS_IME,
305 PRINT_UI_HIERARCHIES,
306 ROTATE_WINDOW,
307 SHOW_SYSTEM_TRAY_BUBBLE,
308 SWITCH_IME, // Switch to another IME depending on the accelerator.
309 TAKE_PARTIAL_SCREENSHOT,
310 TAKE_SCREENSHOT,
311 #if defined(OS_CHROMEOS)
312 BRIGHTNESS_DOWN,
313 BRIGHTNESS_UP,
314 DEBUG_ADD_REMOVE_DISPLAY,
315 DISABLE_CAPS_LOCK,
316 DISABLE_GPU_WATCHDOG,
317 KEYBOARD_BRIGHTNESS_DOWN,
318 KEYBOARD_BRIGHTNESS_UP,
319 TOGGLE_CAPS_LOCK,
320 TOGGLE_SPOKEN_FEEDBACK,
321 TOGGLE_TOUCH_VIEW_TESTING,
322 TOGGLE_MIRROR_MODE,
323 TOGGLE_WIFI,
324 TOUCH_HUD_CLEAR,
325 VOLUME_DOWN,
326 VOLUME_MUTE,
327 VOLUME_UP,
328 #endif
329 #if defined(OS_CHROMEOS) && !defined(NDEBUG)
330 POWER_PRESSED,
331 POWER_RELEASED,
332 #endif // defined(OS_CHROMEOS)
335 const size_t kActionsAllowedAtLoginOrLockScreenLength =
336 arraysize(kActionsAllowedAtLoginOrLockScreen);
338 const AcceleratorAction kActionsAllowedAtLockScreen[] = {
339 EXIT,
342 const size_t kActionsAllowedAtLockScreenLength =
343 arraysize(kActionsAllowedAtLockScreen);
345 const AcceleratorAction kActionsAllowedAtModalWindow[] = {
346 EXIT,
347 MAGNIFY_SCREEN_ZOOM_IN,
348 MAGNIFY_SCREEN_ZOOM_OUT,
349 MEDIA_NEXT_TRACK,
350 MEDIA_PLAY_PAUSE,
351 MEDIA_PREV_TRACK,
352 NEXT_IME,
353 OPEN_FEEDBACK_PAGE,
354 PREVIOUS_IME,
355 PRINT_UI_HIERARCHIES,
356 ROTATE_SCREEN,
357 SCALE_UI_UP,
358 SCALE_UI_DOWN,
359 SCALE_UI_RESET,
360 SHOW_KEYBOARD_OVERLAY,
361 SWITCH_IME,
362 TAKE_PARTIAL_SCREENSHOT,
363 TAKE_SCREENSHOT,
364 #if defined(OS_CHROMEOS)
365 BRIGHTNESS_DOWN,
366 BRIGHTNESS_UP,
367 DEBUG_ADD_REMOVE_DISPLAY,
368 DISABLE_CAPS_LOCK,
369 KEYBOARD_BRIGHTNESS_DOWN,
370 KEYBOARD_BRIGHTNESS_UP,
371 LOCK_SCREEN,
372 POWER_PRESSED,
373 POWER_RELEASED,
374 SWAP_PRIMARY_DISPLAY,
375 TOGGLE_CAPS_LOCK,
376 TOGGLE_MIRROR_MODE,
377 TOGGLE_SPOKEN_FEEDBACK,
378 TOGGLE_WIFI,
379 VOLUME_DOWN,
380 VOLUME_MUTE,
381 VOLUME_UP,
382 #endif
385 const size_t kActionsAllowedAtModalWindowLength =
386 arraysize(kActionsAllowedAtModalWindow);
388 const AcceleratorAction kNonrepeatableActions[] = {
389 // TODO(mazda): Add other actions which should not be repeated.
390 CYCLE_BACKWARD_MRU,
391 CYCLE_FORWARD_MRU,
392 TOGGLE_OVERVIEW,
393 EXIT,
394 PRINT_UI_HIERARCHIES, // Don't fill the logs if the key is held down.
395 ROTATE_SCREEN,
396 ROTATE_WINDOW,
397 SCALE_UI_UP,
398 SCALE_UI_DOWN,
399 SCALE_UI_RESET,
400 TOGGLE_FULLSCREEN,
401 TOGGLE_MAXIMIZED,
402 WINDOW_MINIMIZE,
403 #if defined(OS_CHROMEOS)
404 LOCK_SCREEN,
405 #endif
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
417 MEDIA_NEXT_TRACK,
418 MEDIA_PLAY_PAUSE,
419 MEDIA_PREV_TRACK,
420 NEXT_IME,
421 PREVIOUS_IME,
422 PRINT_UI_HIERARCHIES,
423 ROTATE_SCREEN,
424 SCALE_UI_DOWN,
425 SCALE_UI_RESET,
426 SCALE_UI_UP,
427 SWITCH_IME, // Switch to another IME depending on the accelerator.
428 #if defined(OS_CHROMEOS)
429 BRIGHTNESS_DOWN,
430 BRIGHTNESS_UP,
431 DEBUG_ADD_REMOVE_DISPLAY,
432 DISABLE_CAPS_LOCK,
433 DISABLE_GPU_WATCHDOG,
434 KEYBOARD_BRIGHTNESS_DOWN,
435 KEYBOARD_BRIGHTNESS_UP,
436 POWER_PRESSED,
437 POWER_RELEASED,
438 SWAP_PRIMARY_DISPLAY,
439 TOGGLE_CAPS_LOCK,
440 TOGGLE_MIRROR_MODE,
441 TOGGLE_SPOKEN_FEEDBACK,
442 TOGGLE_WIFI,
443 TOUCH_HUD_CLEAR,
444 VOLUME_DOWN,
445 VOLUME_MUTE,
446 VOLUME_UP,
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,
456 CYCLE_BACKWARD_MRU,
457 CYCLE_FORWARD_MRU,
458 TOGGLE_OVERVIEW,
459 WINDOW_CYCLE_SNAP_DOCK_LEFT,
460 WINDOW_CYCLE_SNAP_DOCK_RIGHT,
461 WINDOW_MINIMIZE,
462 TOGGLE_FULLSCREEN,
463 TOGGLE_MAXIMIZED,
464 WINDOW_POSITION_CENTER,
465 ROTATE_WINDOW,
468 const size_t kActionsNeedingWindowLength = arraysize(kActionsNeedingWindow);
470 } // namespace ash