[Mac] Remove NSApplication from the renderer.
[chromium-blink-merge.git] / ash / accelerators / accelerator_table.cc
bloba099dcc1828d97a35e0d9e7e59aa855a66b6fff6
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 // Single shift release turns off caps lock.
23 { false, ui::VKEY_LSHIFT, ui::EF_NONE, DISABLE_CAPS_LOCK },
24 { false, ui::VKEY_SHIFT, ui::EF_NONE, DISABLE_CAPS_LOCK },
25 { false, ui::VKEY_RSHIFT, ui::EF_NONE, DISABLE_CAPS_LOCK },
27 { true, ui::VKEY_SPACE, ui::EF_CONTROL_DOWN, PREVIOUS_IME },
28 { false, ui::VKEY_SPACE, ui::EF_CONTROL_DOWN, PREVIOUS_IME },
29 // Shortcuts for Japanese IME.
30 { true, ui::VKEY_CONVERT, ui::EF_NONE, SWITCH_IME },
31 { true, ui::VKEY_NONCONVERT, ui::EF_NONE, SWITCH_IME },
32 { true, ui::VKEY_DBE_SBCSCHAR, ui::EF_NONE, SWITCH_IME },
33 { true, ui::VKEY_DBE_DBCSCHAR, ui::EF_NONE, SWITCH_IME },
34 // Shortcut for Koren IME.
35 { true, ui::VKEY_HANGUL, ui::EF_NONE, SWITCH_IME },
37 { true, ui::VKEY_TAB, ui::EF_ALT_DOWN, CYCLE_FORWARD_MRU },
38 { true, ui::VKEY_TAB, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN,
39 CYCLE_BACKWARD_MRU },
40 { true, ui::VKEY_MEDIA_LAUNCH_APP1, ui::EF_NONE, CYCLE_LINEAR },
41 #if defined(OS_CHROMEOS)
42 { true, ui::VKEY_BROWSER_SEARCH, ui::EF_NONE, TOGGLE_APP_LIST },
43 { true, ui::VKEY_WLAN, ui::EF_NONE, TOGGLE_WIFI },
44 { true, ui::VKEY_KBD_BRIGHTNESS_DOWN, ui::EF_NONE, KEYBOARD_BRIGHTNESS_DOWN },
45 { true, ui::VKEY_KBD_BRIGHTNESS_UP, ui::EF_NONE, KEYBOARD_BRIGHTNESS_UP },
46 // Maximize button.
47 { true, ui::VKEY_MEDIA_LAUNCH_APP2, ui::EF_CONTROL_DOWN, TOGGLE_MIRROR_MODE },
48 { true, ui::VKEY_MEDIA_LAUNCH_APP2, ui::EF_ALT_DOWN, SWAP_PRIMARY_DISPLAY },
49 // Cycle windows button.
50 { true, ui::VKEY_MEDIA_LAUNCH_APP1, ui::EF_CONTROL_DOWN, TAKE_SCREENSHOT },
51 { true, ui::VKEY_MEDIA_LAUNCH_APP1, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN,
52 TAKE_PARTIAL_SCREENSHOT },
53 { true, ui::VKEY_BRIGHTNESS_DOWN, ui::EF_NONE, BRIGHTNESS_DOWN },
54 { true, ui::VKEY_BRIGHTNESS_DOWN, ui::EF_ALT_DOWN, KEYBOARD_BRIGHTNESS_DOWN },
55 { true, ui::VKEY_BRIGHTNESS_UP, ui::EF_NONE, BRIGHTNESS_UP },
56 { true, ui::VKEY_BRIGHTNESS_UP, ui::EF_ALT_DOWN, KEYBOARD_BRIGHTNESS_UP },
57 { true, ui::VKEY_BRIGHTNESS_DOWN, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
58 MAGNIFY_SCREEN_ZOOM_OUT},
59 { true, ui::VKEY_BRIGHTNESS_UP, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
60 MAGNIFY_SCREEN_ZOOM_IN},
61 { true, ui::VKEY_L, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, LOCK_SCREEN },
62 // The lock key on Chrome OS keyboards produces F13 scancodes.
63 { true, ui::VKEY_F13, ui::EF_NONE, LOCK_PRESSED },
64 { false, ui::VKEY_F13, ui::EF_NONE, LOCK_RELEASED },
65 { true, ui::VKEY_POWER, ui::EF_NONE, POWER_PRESSED },
66 { false, ui::VKEY_POWER, ui::EF_NONE, POWER_RELEASED },
67 { true, ui::VKEY_M, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN,
68 OPEN_FILE_MANAGER },
69 { true, ui::VKEY_T, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, OPEN_CROSH },
70 { true, ui::VKEY_G, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
71 DISABLE_GPU_WATCHDOG },
72 { true, ui::VKEY_I, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
73 TOUCH_HUD_MODE_CHANGE },
74 { true, ui::VKEY_I, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN,
75 TOUCH_HUD_CLEAR },
76 { true, ui::VKEY_9, ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN,
77 TOUCH_HUD_PROJECTION_TOGGLE },
78 // Accessibility: Spoken feedback shortcuts. The first one is to toggle
79 // spoken feedback on or off. The others are only valid when
80 // spoken feedback is enabled.
81 { true, ui::VKEY_Z, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
82 TOGGLE_SPOKEN_FEEDBACK },
83 { true, ui::VKEY_CONTROL, ui::EF_CONTROL_DOWN, SILENCE_SPOKEN_FEEDBACK},
84 { true, ui::VKEY_OEM_COMMA, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
85 SWITCH_TO_PREVIOUS_USER },
86 { true, ui::VKEY_OEM_PERIOD, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
87 SWITCH_TO_NEXT_USER },
88 // Turning the TouchView maximizing mode on via hotkey for the time being.
89 // TODO(skuhne): Remove once the test isn't needed anymore.
90 { true, ui::VKEY_D, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN,
91 TOGGLE_TOUCH_VIEW_TESTING },
92 #endif // defined(OS_CHROMEOS)
93 { true, ui::VKEY_I, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN, OPEN_FEEDBACK_PAGE },
94 #if !defined(OS_WIN)
95 { true, ui::VKEY_Q, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, EXIT },
96 #endif
97 { true, ui::VKEY_N, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN,
98 NEW_INCOGNITO_WINDOW },
99 { true, ui::VKEY_N, ui::EF_CONTROL_DOWN, NEW_WINDOW },
100 { true, ui::VKEY_T, ui::EF_CONTROL_DOWN, NEW_TAB },
101 { true, ui::VKEY_OEM_MINUS,
102 ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN, SCALE_UI_UP },
103 { true, ui::VKEY_OEM_PLUS,
104 ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN, SCALE_UI_DOWN },
105 { true, ui::VKEY_0,
106 ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN, SCALE_UI_RESET },
107 { true, ui::VKEY_BROWSER_REFRESH,
108 ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN, ROTATE_SCREEN },
109 { true, ui::VKEY_BROWSER_REFRESH,
110 ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
111 ROTATE_WINDOW },
112 { true, ui::VKEY_T, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, RESTORE_TAB },
113 { true, ui::VKEY_PRINT, ui::EF_NONE, TAKE_SCREENSHOT },
114 // On Chrome OS, Search key is mapped to LWIN. The Search key binding should
115 // act on release instead of press when using Search as a modifier key for
116 // extended keyboard shortcuts.
117 { false, ui::VKEY_LWIN, ui::EF_NONE, TOGGLE_APP_LIST },
118 { false, ui::VKEY_LWIN, ui::EF_ALT_DOWN, TOGGLE_CAPS_LOCK },
119 { true, ui::VKEY_MEDIA_LAUNCH_APP2, ui::EF_NONE, TOGGLE_FULLSCREEN },
120 { true, ui::VKEY_MEDIA_LAUNCH_APP2, ui::EF_SHIFT_DOWN, TOGGLE_FULLSCREEN },
121 { true, ui::VKEY_VOLUME_MUTE, ui::EF_NONE, VOLUME_MUTE },
122 { true, ui::VKEY_VOLUME_DOWN, ui::EF_NONE, VOLUME_DOWN },
123 { true, ui::VKEY_VOLUME_UP, ui::EF_NONE, VOLUME_UP },
124 { true, ui::VKEY_L, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN, FOCUS_LAUNCHER },
125 { true, ui::VKEY_HELP, ui::EF_NONE, SHOW_KEYBOARD_OVERLAY },
126 { true, ui::VKEY_OEM_2, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
127 SHOW_KEYBOARD_OVERLAY },
128 { true, ui::VKEY_OEM_2,
129 ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
130 SHOW_KEYBOARD_OVERLAY },
131 { true, ui::VKEY_F14, ui::EF_NONE, SHOW_KEYBOARD_OVERLAY },
132 { true, ui::VKEY_N, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN,
133 SHOW_MESSAGE_CENTER_BUBBLE },
134 { true, ui::VKEY_S, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN,
135 SHOW_SYSTEM_TRAY_BUBBLE },
136 { true, ui::VKEY_ESCAPE, ui::EF_SHIFT_DOWN, SHOW_TASK_MANAGER },
137 { true, ui::VKEY_1, ui::EF_ALT_DOWN, LAUNCH_APP_0 },
138 { true, ui::VKEY_2, ui::EF_ALT_DOWN, LAUNCH_APP_1 },
139 { true, ui::VKEY_3, ui::EF_ALT_DOWN, LAUNCH_APP_2 },
140 { true, ui::VKEY_4, ui::EF_ALT_DOWN, LAUNCH_APP_3 },
141 { true, ui::VKEY_5, ui::EF_ALT_DOWN, LAUNCH_APP_4 },
142 { true, ui::VKEY_6, ui::EF_ALT_DOWN, LAUNCH_APP_5 },
143 { true, ui::VKEY_7, ui::EF_ALT_DOWN, LAUNCH_APP_6 },
144 { true, ui::VKEY_8, ui::EF_ALT_DOWN, LAUNCH_APP_7 },
145 { true, ui::VKEY_9, ui::EF_ALT_DOWN, LAUNCH_LAST_APP },
147 // Window management shortcuts.
148 { true, ui::VKEY_OEM_4, ui::EF_ALT_DOWN, WINDOW_SNAP_LEFT },
149 { true, ui::VKEY_OEM_6, ui::EF_ALT_DOWN, WINDOW_SNAP_RIGHT },
150 // The same accelerator is defined in
151 // c/b/ui/views/accelerator_table.cc in order for the web page to
152 // intercept and process this shortcut. This accelerator is used if the
153 // focused window isn't browser window nor web content.
154 // TODO(stevet/jamescook): Remove this in M33, as well as the copy
155 // referenced above. We want to move away from shortcuts bound to Ctrl
156 // because web content often uses them.
157 { true, ui::VKEY_M, ui::EF_CONTROL_DOWN, WINDOW_MINIMIZE },
158 { true, ui::VKEY_OEM_MINUS, ui::EF_ALT_DOWN, WINDOW_MINIMIZE },
159 { true, ui::VKEY_OEM_PLUS, ui::EF_ALT_DOWN, TOGGLE_MAXIMIZED },
160 { true, ui::VKEY_OEM_PLUS, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN,
161 WINDOW_POSITION_CENTER },
162 { true, ui::VKEY_BROWSER_FORWARD, ui::EF_CONTROL_DOWN, FOCUS_NEXT_PANE },
163 { true, ui::VKEY_BROWSER_BACK, ui::EF_CONTROL_DOWN, FOCUS_PREVIOUS_PANE },
165 // Media Player shortcuts.
166 { true, ui::VKEY_MEDIA_NEXT_TRACK, ui::EF_NONE, MEDIA_NEXT_TRACK},
167 { true, ui::VKEY_MEDIA_PLAY_PAUSE, ui::EF_NONE, MEDIA_PLAY_PAUSE},
168 { true, ui::VKEY_MEDIA_PREV_TRACK, ui::EF_NONE, MEDIA_PREV_TRACK},
170 // Debugging shortcuts that need to be available to end-users in
171 // release builds.
172 { true, ui::VKEY_U, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN,
173 PRINT_UI_HIERARCHIES },
175 { false, ui::VKEY_HOME, ui::EF_SHIFT_DOWN, ACCESSIBLE_FOCUS_PREVIOUS},
176 { false, ui::VKEY_PRIOR, ui::EF_SHIFT_DOWN, ACCESSIBLE_FOCUS_PREVIOUS},
177 { false, ui::VKEY_END, ui::EF_SHIFT_DOWN, ACCESSIBLE_FOCUS_NEXT},
178 { false, ui::VKEY_NEXT, ui::EF_SHIFT_DOWN, ACCESSIBLE_FOCUS_NEXT},
180 // TODO(yusukes): Handle VKEY_MEDIA_STOP, and
181 // VKEY_MEDIA_LAUNCH_MAIL.
184 const size_t kAcceleratorDataLength = arraysize(kAcceleratorData);
186 #if !defined(NDEBUG)
187 const AcceleratorData kDesktopAcceleratorData[] = {
188 #if defined(OS_CHROMEOS)
189 // Extra shortcut for debug build to control magnifier on linux desktop.
190 { true, ui::VKEY_BRIGHTNESS_DOWN, ui::EF_CONTROL_DOWN,
191 MAGNIFY_SCREEN_ZOOM_OUT},
192 { true, ui::VKEY_BRIGHTNESS_UP, ui::EF_CONTROL_DOWN, MAGNIFY_SCREEN_ZOOM_IN},
193 // Extra shortcuts to lock the screen on linux desktop.
194 { true, ui::VKEY_L, ui::EF_ALT_DOWN, LOCK_SCREEN },
195 { true, ui::VKEY_POWER, ui::EF_SHIFT_DOWN, LOCK_PRESSED },
196 { false, ui::VKEY_POWER, ui::EF_SHIFT_DOWN, LOCK_RELEASED },
197 { true, ui::VKEY_D, ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN,
198 ADD_REMOVE_DISPLAY },
199 { true, ui::VKEY_M, ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN,
200 TOGGLE_MIRROR_MODE },
201 { true, ui::VKEY_W, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, TOGGLE_WIFI },
202 // Extra shortcut for display swaping as alt-f4 is taken on linux desktop.
203 { true, ui::VKEY_S, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN,
204 SWAP_PRIMARY_DISPLAY },
205 #endif
206 // Extra shortcut to rotate/scale up/down the screen on linux desktop.
207 { true, ui::VKEY_R,
208 ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, ROTATE_SCREEN },
209 // For testing on systems where Alt-Tab is already mapped.
210 { true, ui::VKEY_W, ui::EF_ALT_DOWN, CYCLE_FORWARD_MRU },
212 { true, ui::VKEY_F11, ui::EF_CONTROL_DOWN, TOGGLE_ROOT_WINDOW_FULL_SCREEN },
213 { true, ui::VKEY_W, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN,
214 CYCLE_BACKWARD_MRU },
215 { true, ui::VKEY_B, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
216 TOGGLE_DESKTOP_BACKGROUND_MODE },
217 { true, ui::VKEY_F, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN,
218 TOGGLE_FULLSCREEN },
221 const size_t kDesktopAcceleratorDataLength = arraysize(kDesktopAcceleratorData);
222 #endif
224 const AcceleratorData kDebugAcceleratorData[] = {
225 { true, ui::VKEY_L, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
226 PRINT_LAYER_HIERARCHY },
227 { true, ui::VKEY_V, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
228 PRINT_VIEW_HIERARCHY },
229 { true, ui::VKEY_W, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
230 PRINT_WINDOW_HIERARCHY },
231 { true, ui::VKEY_S, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
232 DEBUG_TOGGLE_DEVICE_SCALE_FACTOR },
233 { true, ui::VKEY_B, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
234 DEBUG_TOGGLE_SHOW_DEBUG_BORDERS },
235 { true, ui::VKEY_F, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
236 DEBUG_TOGGLE_SHOW_FPS_COUNTER },
237 { true, ui::VKEY_P, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
238 DEBUG_TOGGLE_SHOW_PAINT_RECTS },
241 const size_t kDebugAcceleratorDataLength = arraysize(kDebugAcceleratorData);
243 const AcceleratorAction kReservedActions[] = {
244 // Window cycling accelerators.
245 CYCLE_BACKWARD_MRU, // Shift+Alt+Tab
246 CYCLE_FORWARD_MRU, // Alt+Tab
247 #if defined(OS_CHROMEOS)
248 POWER_PRESSED,
249 POWER_RELEASED,
250 #endif
253 const size_t kReservedActionsLength = arraysize(kReservedActions);
255 const AcceleratorAction kReservedDebugActions[] = {
256 PRINT_LAYER_HIERARCHY,
257 PRINT_VIEW_HIERARCHY,
258 PRINT_WINDOW_HIERARCHY,
259 DEBUG_TOGGLE_DEVICE_SCALE_FACTOR,
260 DEBUG_TOGGLE_SHOW_DEBUG_BORDERS,
261 DEBUG_TOGGLE_SHOW_FPS_COUNTER,
262 DEBUG_TOGGLE_SHOW_PAINT_RECTS,
265 const size_t kReservedDebugActionsLength = arraysize(kReservedDebugActions);
267 const AcceleratorAction kActionsAllowedAtLoginOrLockScreen[] = {
268 BRIGHTNESS_DOWN,
269 BRIGHTNESS_UP,
270 DISABLE_CAPS_LOCK,
271 KEYBOARD_BRIGHTNESS_DOWN,
272 KEYBOARD_BRIGHTNESS_UP,
273 MAGNIFY_SCREEN_ZOOM_IN, // Control+F7
274 MAGNIFY_SCREEN_ZOOM_OUT, // Control+F6
275 NEXT_IME,
276 PREVIOUS_IME,
277 PRINT_LAYER_HIERARCHY,
278 PRINT_UI_HIERARCHIES,
279 PRINT_VIEW_HIERARCHY,
280 PRINT_WINDOW_HIERARCHY,
281 ROTATE_WINDOW,
282 SHOW_SYSTEM_TRAY_BUBBLE,
283 SWITCH_IME, // Switch to another IME depending on the accelerator.
284 TAKE_PARTIAL_SCREENSHOT,
285 TAKE_SCREENSHOT,
286 TOGGLE_CAPS_LOCK,
287 TOGGLE_WIFI,
288 TOUCH_HUD_CLEAR,
289 VOLUME_DOWN,
290 VOLUME_MUTE,
291 VOLUME_UP,
292 #if defined(OS_CHROMEOS)
293 TOGGLE_SPOKEN_FEEDBACK,
294 ADD_REMOVE_DISPLAY,
295 DISABLE_GPU_WATCHDOG,
296 TOGGLE_MIRROR_MODE,
297 #endif
298 #if defined(OS_CHROMEOS) && !defined(NDEBUG)
299 POWER_PRESSED,
300 POWER_RELEASED,
301 #endif // defined(OS_CHROMEOS)
304 const size_t kActionsAllowedAtLoginOrLockScreenLength =
305 arraysize(kActionsAllowedAtLoginOrLockScreen);
307 const AcceleratorAction kActionsAllowedAtLockScreen[] = {
308 EXIT,
311 const size_t kActionsAllowedAtLockScreenLength =
312 arraysize(kActionsAllowedAtLockScreen);
314 const AcceleratorAction kActionsAllowedAtModalWindow[] = {
315 BRIGHTNESS_DOWN,
316 BRIGHTNESS_UP,
317 DISABLE_CAPS_LOCK,
318 EXIT,
319 KEYBOARD_BRIGHTNESS_DOWN,
320 KEYBOARD_BRIGHTNESS_UP,
321 MAGNIFY_SCREEN_ZOOM_IN,
322 MAGNIFY_SCREEN_ZOOM_OUT,
323 MEDIA_NEXT_TRACK,
324 MEDIA_PLAY_PAUSE,
325 MEDIA_PREV_TRACK,
326 NEXT_IME,
327 OPEN_FEEDBACK_PAGE,
328 POWER_PRESSED,
329 POWER_RELEASED,
330 PREVIOUS_IME,
331 PRINT_UI_HIERARCHIES,
332 SHOW_KEYBOARD_OVERLAY,
333 SWITCH_IME,
334 TAKE_PARTIAL_SCREENSHOT,
335 TAKE_SCREENSHOT,
336 TOGGLE_CAPS_LOCK,
337 TOGGLE_WIFI,
338 VOLUME_DOWN,
339 VOLUME_MUTE,
340 VOLUME_UP,
341 #if defined(OS_CHROMEOS)
342 SWAP_PRIMARY_DISPLAY,
343 TOGGLE_SPOKEN_FEEDBACK,
344 #if !defined(NDEBUG)
345 ADD_REMOVE_DISPLAY,
346 #endif
347 LOCK_SCREEN,
348 TOGGLE_MIRROR_MODE,
349 #endif
352 const size_t kActionsAllowedAtModalWindowLength =
353 arraysize(kActionsAllowedAtModalWindow);
355 const AcceleratorAction kNonrepeatableActions[] = {
356 // TODO(mazda): Add other actions which should not be repeated.
357 CYCLE_BACKWARD_MRU,
358 CYCLE_FORWARD_MRU,
359 CYCLE_LINEAR,
360 EXIT,
361 PRINT_UI_HIERARCHIES, // Don't fill the logs if the key is held down.
362 ROTATE_SCREEN,
363 ROTATE_WINDOW,
364 SCALE_UI_UP,
365 SCALE_UI_DOWN,
366 SCALE_UI_RESET,
367 TOGGLE_FULLSCREEN,
368 TOGGLE_MAXIMIZED,
369 WINDOW_MINIMIZE,
372 const size_t kNonrepeatableActionsLength =
373 arraysize(kNonrepeatableActions);
375 const AcceleratorAction kActionsAllowedInAppMode[] = {
376 BRIGHTNESS_DOWN,
377 BRIGHTNESS_UP,
378 CYCLE_BACKWARD_MRU,
379 CYCLE_FORWARD_MRU,
380 CYCLE_LINEAR,
381 DISABLE_CAPS_LOCK,
382 KEYBOARD_BRIGHTNESS_DOWN,
383 KEYBOARD_BRIGHTNESS_UP,
384 MAGNIFY_SCREEN_ZOOM_IN, // Control+F7
385 MAGNIFY_SCREEN_ZOOM_OUT, // Control+F6
386 MEDIA_NEXT_TRACK,
387 MEDIA_PLAY_PAUSE,
388 MEDIA_PREV_TRACK,
389 NEXT_IME,
390 POWER_PRESSED,
391 POWER_RELEASED,
392 PREVIOUS_IME,
393 PRINT_LAYER_HIERARCHY,
394 PRINT_UI_HIERARCHIES,
395 PRINT_VIEW_HIERARCHY,
396 PRINT_WINDOW_HIERARCHY,
397 ROTATE_SCREEN,
398 SCALE_UI_DOWN,
399 SCALE_UI_RESET,
400 SCALE_UI_UP,
401 SWITCH_IME, // Switch to another IME depending on the accelerator.
402 TOGGLE_CAPS_LOCK,
403 TOGGLE_WIFI,
404 TOUCH_HUD_CLEAR,
405 VOLUME_DOWN,
406 VOLUME_MUTE,
407 VOLUME_UP,
408 #if defined(OS_CHROMEOS)
409 SWAP_PRIMARY_DISPLAY,
410 TOGGLE_SPOKEN_FEEDBACK,
411 ADD_REMOVE_DISPLAY,
412 DISABLE_GPU_WATCHDOG,
413 TOGGLE_MIRROR_MODE,
414 #endif // defined(OS_CHROMEOS)
417 const size_t kActionsAllowedInAppModeLength =
418 arraysize(kActionsAllowedInAppMode);
420 const AcceleratorAction kActionsNeedingWindow[] = {
421 ACCESSIBLE_FOCUS_NEXT,
422 ACCESSIBLE_FOCUS_PREVIOUS,
423 CYCLE_BACKWARD_MRU,
424 CYCLE_FORWARD_MRU,
425 CYCLE_LINEAR,
426 WINDOW_SNAP_LEFT,
427 WINDOW_SNAP_RIGHT,
428 WINDOW_MINIMIZE,
429 TOGGLE_FULLSCREEN,
430 TOGGLE_MAXIMIZED,
431 WINDOW_POSITION_CENTER,
432 ROTATE_WINDOW,
435 const size_t kActionsNeedingWindowLength = arraysize(kActionsNeedingWindow);
437 } // namespace ash