Files.app: Start to use new metadata models in DirectoryContents.
[chromium-blink-merge.git] / ash / accelerators / accelerator_table.cc
blob0faf61076c8f153ffd6e1e81318932d71ecc70da
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 "base/basictypes.h"
9 namespace ash {
11 const AcceleratorData kAcceleratorData[] = {
12 // We have to define 3 entries for Shift+Alt. VKEY_[LR]MENU might be sent to
13 // the accelerator controller when RenderWidgetHostViewAura is focused, and
14 // VKEY_MENU might be when it's not (e.g. when NativeWidgetAura is focused).
15 { false, ui::VKEY_LMENU, ui::EF_SHIFT_DOWN, NEXT_IME },
16 { false, ui::VKEY_MENU, ui::EF_SHIFT_DOWN, NEXT_IME },
17 { false, ui::VKEY_RMENU, ui::EF_SHIFT_DOWN, NEXT_IME },
18 // The same is true for Alt+Shift.
19 { false, ui::VKEY_LSHIFT, ui::EF_ALT_DOWN, NEXT_IME },
20 { false, ui::VKEY_SHIFT, ui::EF_ALT_DOWN, NEXT_IME },
21 { false, ui::VKEY_RSHIFT, ui::EF_ALT_DOWN, NEXT_IME },
22 { true, ui::VKEY_SPACE, ui::EF_CONTROL_DOWN, PREVIOUS_IME },
23 { false, ui::VKEY_SPACE, ui::EF_CONTROL_DOWN, PREVIOUS_IME },
24 // Shortcuts for Japanese IME.
25 { true, ui::VKEY_CONVERT, ui::EF_NONE, SWITCH_IME },
26 { true, ui::VKEY_NONCONVERT, ui::EF_NONE, SWITCH_IME },
27 { true, ui::VKEY_DBE_SBCSCHAR, ui::EF_NONE, SWITCH_IME },
28 { true, ui::VKEY_DBE_DBCSCHAR, ui::EF_NONE, SWITCH_IME },
29 // Shortcut for Koren IME.
30 { true, ui::VKEY_HANGUL, ui::EF_NONE, SWITCH_IME },
32 { true, ui::VKEY_TAB, ui::EF_ALT_DOWN, CYCLE_FORWARD_MRU },
33 { true, ui::VKEY_TAB, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN,
34 CYCLE_BACKWARD_MRU },
35 { true, ui::VKEY_MEDIA_LAUNCH_APP1, ui::EF_NONE, TOGGLE_OVERVIEW },
36 #if defined(OS_CHROMEOS)
37 { true, ui::VKEY_BROWSER_SEARCH, ui::EF_NONE, TOGGLE_APP_LIST },
38 { true, ui::VKEY_WLAN, ui::EF_NONE, TOGGLE_WIFI },
39 { true, ui::VKEY_KBD_BRIGHTNESS_DOWN, ui::EF_NONE, KEYBOARD_BRIGHTNESS_DOWN },
40 { true, ui::VKEY_KBD_BRIGHTNESS_UP, ui::EF_NONE, KEYBOARD_BRIGHTNESS_UP },
41 // Maximize button.
42 { true, ui::VKEY_MEDIA_LAUNCH_APP2, ui::EF_CONTROL_DOWN, TOGGLE_MIRROR_MODE },
43 { true, ui::VKEY_MEDIA_LAUNCH_APP2, ui::EF_ALT_DOWN, SWAP_PRIMARY_DISPLAY },
44 // Cycle windows button.
45 { true, ui::VKEY_MEDIA_LAUNCH_APP1, ui::EF_CONTROL_DOWN, TAKE_SCREENSHOT },
46 { true, ui::VKEY_MEDIA_LAUNCH_APP1, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN,
47 TAKE_PARTIAL_SCREENSHOT },
48 { true, ui::VKEY_BRIGHTNESS_DOWN, ui::EF_NONE, BRIGHTNESS_DOWN },
49 { true, ui::VKEY_BRIGHTNESS_DOWN, ui::EF_ALT_DOWN, KEYBOARD_BRIGHTNESS_DOWN },
50 { true, ui::VKEY_BRIGHTNESS_UP, ui::EF_NONE, BRIGHTNESS_UP },
51 { true, ui::VKEY_BRIGHTNESS_UP, ui::EF_ALT_DOWN, KEYBOARD_BRIGHTNESS_UP },
52 { true, ui::VKEY_BRIGHTNESS_DOWN, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
53 MAGNIFY_SCREEN_ZOOM_OUT},
54 { true, ui::VKEY_BRIGHTNESS_UP, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
55 MAGNIFY_SCREEN_ZOOM_IN},
56 { true, ui::VKEY_L, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, LOCK_SCREEN },
57 // The lock key on Chrome OS keyboards produces F13 scancodes.
58 { true, ui::VKEY_F13, ui::EF_NONE, LOCK_PRESSED },
59 { false, ui::VKEY_F13, ui::EF_NONE, LOCK_RELEASED },
60 // Generic keyboards can use VKEY_SLEEP to mimic ChromeOS keyboard's lock key.
61 { true, ui::VKEY_SLEEP, ui::EF_NONE, LOCK_PRESSED },
62 { false, ui::VKEY_SLEEP, ui::EF_NONE, LOCK_RELEASED },
63 { true, ui::VKEY_POWER, ui::EF_NONE, POWER_PRESSED },
64 { false, ui::VKEY_POWER, ui::EF_NONE, POWER_RELEASED },
65 { true, ui::VKEY_M, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN,
66 OPEN_FILE_MANAGER },
67 { true, ui::VKEY_OEM_2, ui::EF_CONTROL_DOWN, OPEN_GET_HELP },
68 { true, ui::VKEY_OEM_2, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN,
69 OPEN_GET_HELP },
70 { true, ui::VKEY_T, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, OPEN_CROSH },
71 { true, ui::VKEY_G, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
72 DISABLE_GPU_WATCHDOG },
73 { true, ui::VKEY_I, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
74 TOUCH_HUD_MODE_CHANGE },
75 { true, ui::VKEY_I, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN,
76 TOUCH_HUD_CLEAR },
77 { true, ui::VKEY_P, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
78 TOUCH_HUD_PROJECTION_TOGGLE },
79 // Accessibility: Spoken feedback shortcuts. The first one is to toggle
80 // spoken feedback on or off. The others are only valid when
81 // spoken feedback is enabled.
82 { true, ui::VKEY_Z, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
83 TOGGLE_SPOKEN_FEEDBACK },
84 { true, ui::VKEY_CONTROL, ui::EF_CONTROL_DOWN, SILENCE_SPOKEN_FEEDBACK},
85 { true, ui::VKEY_LCONTROL, ui::EF_CONTROL_DOWN, SILENCE_SPOKEN_FEEDBACK},
86 { true, ui::VKEY_RCONTROL, ui::EF_CONTROL_DOWN, SILENCE_SPOKEN_FEEDBACK},
87 { true, ui::VKEY_OEM_COMMA, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
88 SWITCH_TO_PREVIOUS_USER },
89 { true, ui::VKEY_OEM_PERIOD, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
90 SWITCH_TO_NEXT_USER },
91 // Turning the TouchView maximizing mode on via hotkey for the time being.
92 // TODO(skuhne): Remove once the test isn't needed anymore.
93 { true, ui::VKEY_8, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN,
94 TOGGLE_TOUCH_VIEW_TESTING },
95 // Single shift release turns off caps lock.
96 { false, ui::VKEY_LSHIFT, ui::EF_NONE, DISABLE_CAPS_LOCK },
97 { false, ui::VKEY_SHIFT, ui::EF_NONE, DISABLE_CAPS_LOCK },
98 { false, ui::VKEY_RSHIFT, ui::EF_NONE, DISABLE_CAPS_LOCK },
99 { false, ui::VKEY_LWIN, ui::EF_ALT_DOWN, TOGGLE_CAPS_LOCK },
100 { true, ui::VKEY_VOLUME_MUTE, ui::EF_NONE, VOLUME_MUTE },
101 { true, ui::VKEY_VOLUME_DOWN, ui::EF_NONE, VOLUME_DOWN },
102 { true, ui::VKEY_VOLUME_UP, ui::EF_NONE, VOLUME_UP },
103 #endif // defined(OS_CHROMEOS)
104 { true, ui::VKEY_I, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN, OPEN_FEEDBACK_PAGE },
105 #if !defined(OS_WIN)
106 { true, ui::VKEY_Q, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, EXIT },
107 #endif
108 { true, ui::VKEY_N, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN,
109 NEW_INCOGNITO_WINDOW },
110 { true, ui::VKEY_N, ui::EF_CONTROL_DOWN, NEW_WINDOW },
111 { true, ui::VKEY_T, ui::EF_CONTROL_DOWN, NEW_TAB },
112 { true, ui::VKEY_OEM_MINUS,
113 ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN, SCALE_UI_UP },
114 { true, ui::VKEY_OEM_PLUS,
115 ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN, SCALE_UI_DOWN },
116 { true, ui::VKEY_0,
117 ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN, SCALE_UI_RESET },
118 { true, ui::VKEY_BROWSER_REFRESH,
119 ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN, ROTATE_SCREEN },
120 { true, ui::VKEY_BROWSER_REFRESH,
121 ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
122 ROTATE_WINDOW },
123 { true, ui::VKEY_T, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, RESTORE_TAB },
124 { true, ui::VKEY_PRINT, ui::EF_NONE, TAKE_SCREENSHOT },
125 // On Chrome OS, Search key is mapped to LWIN. The Search key binding should
126 // act on release instead of press when using Search as a modifier key for
127 // extended keyboard shortcuts.
128 { false, ui::VKEY_LWIN, ui::EF_NONE, TOGGLE_APP_LIST },
129 { true, ui::VKEY_MEDIA_LAUNCH_APP2, ui::EF_NONE, TOGGLE_FULLSCREEN },
130 { true, ui::VKEY_MEDIA_LAUNCH_APP2, ui::EF_SHIFT_DOWN, TOGGLE_FULLSCREEN },
131 { true, ui::VKEY_L, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN, FOCUS_SHELF },
132 { true, ui::VKEY_HELP, ui::EF_NONE, SHOW_KEYBOARD_OVERLAY },
133 { true, ui::VKEY_OEM_2, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
134 SHOW_KEYBOARD_OVERLAY },
135 { true, ui::VKEY_OEM_2,
136 ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
137 SHOW_KEYBOARD_OVERLAY },
138 { true, ui::VKEY_F14, ui::EF_NONE, SHOW_KEYBOARD_OVERLAY },
139 { true, ui::VKEY_N, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN,
140 SHOW_MESSAGE_CENTER_BUBBLE },
141 { true, ui::VKEY_S, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN,
142 SHOW_SYSTEM_TRAY_BUBBLE },
143 { true, ui::VKEY_ESCAPE, ui::EF_SHIFT_DOWN, SHOW_TASK_MANAGER },
144 { true, ui::VKEY_1, ui::EF_ALT_DOWN, LAUNCH_APP_0 },
145 { true, ui::VKEY_2, ui::EF_ALT_DOWN, LAUNCH_APP_1 },
146 { true, ui::VKEY_3, ui::EF_ALT_DOWN, LAUNCH_APP_2 },
147 { true, ui::VKEY_4, ui::EF_ALT_DOWN, LAUNCH_APP_3 },
148 { true, ui::VKEY_5, ui::EF_ALT_DOWN, LAUNCH_APP_4 },
149 { true, ui::VKEY_6, ui::EF_ALT_DOWN, LAUNCH_APP_5 },
150 { true, ui::VKEY_7, ui::EF_ALT_DOWN, LAUNCH_APP_6 },
151 { true, ui::VKEY_8, ui::EF_ALT_DOWN, LAUNCH_APP_7 },
152 { true, ui::VKEY_9, ui::EF_ALT_DOWN, LAUNCH_LAST_APP },
154 // Window management shortcuts.
155 { true, ui::VKEY_OEM_4, ui::EF_ALT_DOWN, WINDOW_CYCLE_SNAP_DOCK_LEFT },
156 { true, ui::VKEY_OEM_6, ui::EF_ALT_DOWN, WINDOW_CYCLE_SNAP_DOCK_RIGHT },
157 { true, ui::VKEY_OEM_MINUS, ui::EF_ALT_DOWN, WINDOW_MINIMIZE },
158 { true, ui::VKEY_OEM_PLUS, ui::EF_ALT_DOWN, TOGGLE_MAXIMIZED },
159 { true, ui::VKEY_OEM_PLUS, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN,
160 WINDOW_POSITION_CENTER },
161 { true, ui::VKEY_BROWSER_FORWARD, ui::EF_CONTROL_DOWN, FOCUS_NEXT_PANE },
162 { true, ui::VKEY_BROWSER_BACK, ui::EF_CONTROL_DOWN, FOCUS_PREVIOUS_PANE },
164 // Media Player shortcuts.
165 { true, ui::VKEY_MEDIA_NEXT_TRACK, ui::EF_NONE, MEDIA_NEXT_TRACK},
166 { true, ui::VKEY_MEDIA_PLAY_PAUSE, ui::EF_NONE, MEDIA_PLAY_PAUSE},
167 { true, ui::VKEY_MEDIA_PREV_TRACK, ui::EF_NONE, MEDIA_PREV_TRACK},
169 // Debugging shortcuts that need to be available to end-users in
170 // release builds.
171 { true, ui::VKEY_U, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN,
172 PRINT_UI_HIERARCHIES },
174 { false, ui::VKEY_HOME, ui::EF_SHIFT_DOWN, ACCESSIBLE_FOCUS_PREVIOUS},
175 { false, ui::VKEY_PRIOR, ui::EF_SHIFT_DOWN, ACCESSIBLE_FOCUS_PREVIOUS},
176 { false, ui::VKEY_END, ui::EF_SHIFT_DOWN, ACCESSIBLE_FOCUS_NEXT},
177 { false, ui::VKEY_NEXT, ui::EF_SHIFT_DOWN, ACCESSIBLE_FOCUS_NEXT},
179 // TODO(yusukes): Handle VKEY_MEDIA_STOP, and
180 // VKEY_MEDIA_LAUNCH_MAIL.
183 const size_t kAcceleratorDataLength = arraysize(kAcceleratorData);
185 const AcceleratorData kDebugAcceleratorData[] = {
186 #if defined(OS_CHROMEOS)
187 // Extra shortcut for debug build to control magnifier on linux desktop.
188 { true, ui::VKEY_BRIGHTNESS_DOWN, ui::EF_CONTROL_DOWN,
189 MAGNIFY_SCREEN_ZOOM_OUT},
190 { true, ui::VKEY_BRIGHTNESS_UP, ui::EF_CONTROL_DOWN, MAGNIFY_SCREEN_ZOOM_IN},
191 // Extra shortcuts to lock the screen on linux desktop.
192 { true, ui::VKEY_L, ui::EF_ALT_DOWN, LOCK_SCREEN },
193 { true, ui::VKEY_POWER, ui::EF_SHIFT_DOWN, LOCK_PRESSED },
194 { false, ui::VKEY_POWER, ui::EF_SHIFT_DOWN, LOCK_RELEASED },
195 { true, ui::VKEY_D, ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN,
196 DEBUG_ADD_REMOVE_DISPLAY },
197 { true, ui::VKEY_M, ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN,
198 TOGGLE_MIRROR_MODE },
199 { true, ui::VKEY_W, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, TOGGLE_WIFI },
200 // Extra shortcut for display swapping as alt-f4 is taken on linux desktop.
201 { true, ui::VKEY_S, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN,
202 SWAP_PRIMARY_DISPLAY },
203 #endif
204 // Extra shortcut to rotate/scale up/down the screen on linux desktop.
205 { true, ui::VKEY_R,
206 ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, ROTATE_SCREEN },
207 // For testing on systems where Alt-Tab is already mapped.
208 { true, ui::VKEY_W, ui::EF_ALT_DOWN, CYCLE_FORWARD_MRU },
209 { true, ui::VKEY_F11, ui::EF_CONTROL_DOWN,
210 DEBUG_TOGGLE_ROOT_WINDOW_FULL_SCREEN },
211 { true, ui::VKEY_W, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN,
212 CYCLE_BACKWARD_MRU },
213 { true, ui::VKEY_B, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
214 DEBUG_TOGGLE_DESKTOP_BACKGROUND_MODE },
215 { true, ui::VKEY_F, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN,
216 TOGGLE_FULLSCREEN },
217 { true, ui::VKEY_L, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
218 DEBUG_PRINT_LAYER_HIERARCHY },
219 { true, ui::VKEY_V, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
220 DEBUG_PRINT_VIEW_HIERARCHY },
221 { true, ui::VKEY_W, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
222 DEBUG_PRINT_WINDOW_HIERARCHY },
223 { true, ui::VKEY_S, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
224 DEBUG_TOGGLE_DEVICE_SCALE_FACTOR },
225 { true, ui::VKEY_B, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
226 DEBUG_TOGGLE_SHOW_DEBUG_BORDERS },
227 { true, ui::VKEY_F, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
228 DEBUG_TOGGLE_SHOW_FPS_COUNTER },
229 { true, ui::VKEY_P, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
230 DEBUG_TOGGLE_SHOW_PAINT_RECTS },
233 const size_t kDebugAcceleratorDataLength = arraysize(kDebugAcceleratorData);
235 const AcceleratorAction kPreferredActions[] = {
236 // Window cycling accelerators.
237 CYCLE_BACKWARD_MRU, // Shift+Alt+Tab
238 CYCLE_FORWARD_MRU, // Alt+Tab
241 const size_t kPreferredActionsLength = arraysize(kPreferredActions);
243 const AcceleratorAction kReservedActions[] = {
244 #if defined(OS_CHROMEOS)
245 POWER_PRESSED,
246 POWER_RELEASED,
247 #else
248 DUMMY_FOR_RESERVED,
249 #endif
252 const size_t kReservedActionsLength = arraysize(kReservedActions);
254 const AcceleratorAction kActionsAllowedAtLoginOrLockScreen[] = {
255 DEBUG_PRINT_LAYER_HIERARCHY,
256 DEBUG_PRINT_VIEW_HIERARCHY,
257 DEBUG_PRINT_WINDOW_HIERARCHY,
258 MAGNIFY_SCREEN_ZOOM_IN, // Control+F7
259 MAGNIFY_SCREEN_ZOOM_OUT, // Control+F6
260 NEXT_IME,
261 PREVIOUS_IME,
262 PRINT_UI_HIERARCHIES,
263 ROTATE_WINDOW,
264 SHOW_SYSTEM_TRAY_BUBBLE,
265 SWITCH_IME, // Switch to another IME depending on the accelerator.
266 TAKE_PARTIAL_SCREENSHOT,
267 TAKE_SCREENSHOT,
268 #if defined(OS_CHROMEOS)
269 BRIGHTNESS_DOWN,
270 BRIGHTNESS_UP,
271 DEBUG_ADD_REMOVE_DISPLAY,
272 DISABLE_CAPS_LOCK,
273 DISABLE_GPU_WATCHDOG,
274 KEYBOARD_BRIGHTNESS_DOWN,
275 KEYBOARD_BRIGHTNESS_UP,
276 TOGGLE_CAPS_LOCK,
277 TOGGLE_SPOKEN_FEEDBACK,
278 TOGGLE_TOUCH_VIEW_TESTING,
279 TOGGLE_MIRROR_MODE,
280 TOGGLE_WIFI,
281 TOUCH_HUD_CLEAR,
282 VOLUME_DOWN,
283 VOLUME_MUTE,
284 VOLUME_UP,
285 #endif
286 #if defined(OS_CHROMEOS) && !defined(NDEBUG)
287 POWER_PRESSED,
288 POWER_RELEASED,
289 #endif // defined(OS_CHROMEOS)
292 const size_t kActionsAllowedAtLoginOrLockScreenLength =
293 arraysize(kActionsAllowedAtLoginOrLockScreen);
295 const AcceleratorAction kActionsAllowedAtLockScreen[] = {
296 EXIT,
299 const size_t kActionsAllowedAtLockScreenLength =
300 arraysize(kActionsAllowedAtLockScreen);
302 const AcceleratorAction kActionsAllowedAtModalWindow[] = {
303 EXIT,
304 MAGNIFY_SCREEN_ZOOM_IN,
305 MAGNIFY_SCREEN_ZOOM_OUT,
306 MEDIA_NEXT_TRACK,
307 MEDIA_PLAY_PAUSE,
308 MEDIA_PREV_TRACK,
309 NEXT_IME,
310 OPEN_FEEDBACK_PAGE,
311 PREVIOUS_IME,
312 PRINT_UI_HIERARCHIES,
313 ROTATE_SCREEN,
314 SCALE_UI_UP,
315 SCALE_UI_DOWN,
316 SCALE_UI_RESET,
317 SHOW_KEYBOARD_OVERLAY,
318 SWITCH_IME,
319 TAKE_PARTIAL_SCREENSHOT,
320 TAKE_SCREENSHOT,
321 #if defined(OS_CHROMEOS)
322 BRIGHTNESS_DOWN,
323 BRIGHTNESS_UP,
324 DEBUG_ADD_REMOVE_DISPLAY,
325 DISABLE_CAPS_LOCK,
326 KEYBOARD_BRIGHTNESS_DOWN,
327 KEYBOARD_BRIGHTNESS_UP,
328 LOCK_SCREEN,
329 POWER_PRESSED,
330 POWER_RELEASED,
331 SWAP_PRIMARY_DISPLAY,
332 TOGGLE_CAPS_LOCK,
333 TOGGLE_MIRROR_MODE,
334 TOGGLE_SPOKEN_FEEDBACK,
335 TOGGLE_WIFI,
336 VOLUME_DOWN,
337 VOLUME_MUTE,
338 VOLUME_UP,
339 #endif
342 const size_t kActionsAllowedAtModalWindowLength =
343 arraysize(kActionsAllowedAtModalWindow);
345 const AcceleratorAction kNonrepeatableActions[] = {
346 // TODO(mazda): Add other actions which should not be repeated.
347 CYCLE_BACKWARD_MRU,
348 CYCLE_FORWARD_MRU,
349 TOGGLE_OVERVIEW,
350 EXIT,
351 PRINT_UI_HIERARCHIES, // Don't fill the logs if the key is held down.
352 ROTATE_SCREEN,
353 ROTATE_WINDOW,
354 SCALE_UI_UP,
355 SCALE_UI_DOWN,
356 SCALE_UI_RESET,
357 TOGGLE_FULLSCREEN,
358 TOGGLE_MAXIMIZED,
359 WINDOW_MINIMIZE,
362 const size_t kNonrepeatableActionsLength =
363 arraysize(kNonrepeatableActions);
365 const AcceleratorAction kActionsAllowedInAppMode[] = {
366 DEBUG_PRINT_LAYER_HIERARCHY,
367 DEBUG_PRINT_VIEW_HIERARCHY,
368 DEBUG_PRINT_WINDOW_HIERARCHY,
369 MAGNIFY_SCREEN_ZOOM_IN, // Control+F7
370 MAGNIFY_SCREEN_ZOOM_OUT, // Control+F6
371 MEDIA_NEXT_TRACK,
372 MEDIA_PLAY_PAUSE,
373 MEDIA_PREV_TRACK,
374 NEXT_IME,
375 PREVIOUS_IME,
376 PRINT_UI_HIERARCHIES,
377 ROTATE_SCREEN,
378 SCALE_UI_DOWN,
379 SCALE_UI_RESET,
380 SCALE_UI_UP,
381 SWITCH_IME, // Switch to another IME depending on the accelerator.
382 #if defined(OS_CHROMEOS)
383 BRIGHTNESS_DOWN,
384 BRIGHTNESS_UP,
385 DEBUG_ADD_REMOVE_DISPLAY,
386 DISABLE_CAPS_LOCK,
387 DISABLE_GPU_WATCHDOG,
388 KEYBOARD_BRIGHTNESS_DOWN,
389 KEYBOARD_BRIGHTNESS_UP,
390 POWER_PRESSED,
391 POWER_RELEASED,
392 SWAP_PRIMARY_DISPLAY,
393 TOGGLE_CAPS_LOCK,
394 TOGGLE_MIRROR_MODE,
395 TOGGLE_SPOKEN_FEEDBACK,
396 TOGGLE_WIFI,
397 TOUCH_HUD_CLEAR,
398 VOLUME_DOWN,
399 VOLUME_MUTE,
400 VOLUME_UP,
401 #endif // defined(OS_CHROMEOS)
404 const size_t kActionsAllowedInAppModeLength =
405 arraysize(kActionsAllowedInAppMode);
407 const AcceleratorAction kActionsNeedingWindow[] = {
408 ACCESSIBLE_FOCUS_NEXT,
409 ACCESSIBLE_FOCUS_PREVIOUS,
410 CYCLE_BACKWARD_MRU,
411 CYCLE_FORWARD_MRU,
412 TOGGLE_OVERVIEW,
413 WINDOW_CYCLE_SNAP_DOCK_LEFT,
414 WINDOW_CYCLE_SNAP_DOCK_RIGHT,
415 WINDOW_MINIMIZE,
416 TOGGLE_FULLSCREEN,
417 TOGGLE_MAXIMIZED,
418 WINDOW_POSITION_CENTER,
419 ROTATE_WINDOW,
422 const size_t kActionsNeedingWindowLength = arraysize(kActionsNeedingWindow);
424 } // namespace ash