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. 4 5 #include "ash/accelerators/accelerator_table.h" 6 7 #include "base/basictypes.h" 8 9 namespace ash { 10 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 }, 31 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 { true, ui::VKEY_POWER, ui::EF_NONE, POWER_PRESSED }, 61 { false, ui::VKEY_POWER, ui::EF_NONE, POWER_RELEASED }, 62 { true, ui::VKEY_M, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN, 63 OPEN_FILE_MANAGER }, 64 { true, ui::VKEY_T, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, OPEN_CROSH }, 65 { true, ui::VKEY_G, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, 66 DISABLE_GPU_WATCHDOG }, 67 { true, ui::VKEY_I, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, 68 TOUCH_HUD_MODE_CHANGE }, 69 { true, ui::VKEY_I, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN, 70 TOUCH_HUD_CLEAR }, 71 { true, ui::VKEY_P, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, 72 TOUCH_HUD_PROJECTION_TOGGLE }, 73 // Accessibility: Spoken feedback shortcuts. The first one is to toggle 74 // spoken feedback on or off. The others are only valid when 75 // spoken feedback is enabled. 76 { true, ui::VKEY_Z, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, 77 TOGGLE_SPOKEN_FEEDBACK }, 78 { true, ui::VKEY_CONTROL, ui::EF_CONTROL_DOWN, SILENCE_SPOKEN_FEEDBACK}, 79 { true, ui::VKEY_OEM_COMMA, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, 80 SWITCH_TO_PREVIOUS_USER }, 81 { true, ui::VKEY_OEM_PERIOD, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, 82 SWITCH_TO_NEXT_USER }, 83 // Turning the TouchView maximizing mode on via hotkey for the time being. 84 // TODO(skuhne): Remove once the test isn't needed anymore. 85 { true, ui::VKEY_8, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN, 86 TOGGLE_TOUCH_VIEW_TESTING }, 87 // Single shift release turns off caps lock. 88 { false, ui::VKEY_LSHIFT, ui::EF_NONE, DISABLE_CAPS_LOCK }, 89 { false, ui::VKEY_SHIFT, ui::EF_NONE, DISABLE_CAPS_LOCK }, 90 { false, ui::VKEY_RSHIFT, ui::EF_NONE, DISABLE_CAPS_LOCK }, 91 { false, ui::VKEY_LWIN, ui::EF_ALT_DOWN, TOGGLE_CAPS_LOCK }, 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 { true, ui::VKEY_MEDIA_LAUNCH_APP2, ui::EF_NONE, TOGGLE_FULLSCREEN }, 119 { true, ui::VKEY_MEDIA_LAUNCH_APP2, ui::EF_SHIFT_DOWN, TOGGLE_FULLSCREEN }, 120 { true, ui::VKEY_VOLUME_MUTE, ui::EF_NONE, VOLUME_MUTE }, 121 { true, ui::VKEY_VOLUME_DOWN, ui::EF_NONE, VOLUME_DOWN }, 122 { true, ui::VKEY_VOLUME_UP, ui::EF_NONE, VOLUME_UP }, 123 { true, ui::VKEY_L, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN, FOCUS_LAUNCHER }, 124 { true, ui::VKEY_HELP, ui::EF_NONE, SHOW_KEYBOARD_OVERLAY }, 125 { true, ui::VKEY_OEM_2, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, 126 SHOW_KEYBOARD_OVERLAY }, 127 { true, ui::VKEY_OEM_2, 128 ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, 129 SHOW_KEYBOARD_OVERLAY }, 130 { true, ui::VKEY_F14, ui::EF_NONE, SHOW_KEYBOARD_OVERLAY }, 131 { true, ui::VKEY_N, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN, 132 SHOW_MESSAGE_CENTER_BUBBLE }, 133 { true, ui::VKEY_S, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN, 134 SHOW_SYSTEM_TRAY_BUBBLE }, 135 { true, ui::VKEY_ESCAPE, ui::EF_SHIFT_DOWN, SHOW_TASK_MANAGER }, 136 { true, ui::VKEY_1, ui::EF_ALT_DOWN, LAUNCH_APP_0 }, 137 { true, ui::VKEY_2, ui::EF_ALT_DOWN, LAUNCH_APP_1 }, 138 { true, ui::VKEY_3, ui::EF_ALT_DOWN, LAUNCH_APP_2 }, 139 { true, ui::VKEY_4, ui::EF_ALT_DOWN, LAUNCH_APP_3 }, 140 { true, ui::VKEY_5, ui::EF_ALT_DOWN, LAUNCH_APP_4 }, 141 { true, ui::VKEY_6, ui::EF_ALT_DOWN, LAUNCH_APP_5 }, 142 { true, ui::VKEY_7, ui::EF_ALT_DOWN, LAUNCH_APP_6 }, 143 { true, ui::VKEY_8, ui::EF_ALT_DOWN, LAUNCH_APP_7 }, 144 { true, ui::VKEY_9, ui::EF_ALT_DOWN, LAUNCH_LAST_APP }, 145 146 // Window management shortcuts. 147 { true, ui::VKEY_OEM_4, ui::EF_ALT_DOWN, WINDOW_SNAP_LEFT }, 148 { true, ui::VKEY_OEM_6, ui::EF_ALT_DOWN, WINDOW_SNAP_RIGHT }, 149 // The same accelerator is defined in 150 // c/b/ui/views/accelerator_table.cc in order for the web page to 151 // intercept and process this shortcut. This accelerator is used if the 152 // focused window isn't browser window nor web content. 153 // TODO(stevet/jamescook): Remove this in M33, as well as the copy 154 // referenced above. We want to move away from shortcuts bound to Ctrl 155 // because web content often uses them. 156 { true, ui::VKEY_M, ui::EF_CONTROL_DOWN, WINDOW_MINIMIZE }, 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 }, 163 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}, 168 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 }, 173 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}, 178 179 // TODO(yusukes): Handle VKEY_MEDIA_STOP, and 180 // VKEY_MEDIA_LAUNCH_MAIL. 181 }; 182 183 const size_t kAcceleratorDataLength = arraysize(kAcceleratorData); 184 185 #if !defined(NDEBUG) 186 const AcceleratorData kDesktopAcceleratorData[] = { 187 #if defined(OS_CHROMEOS) 188 // Extra shortcut for debug build to control magnifier on linux desktop. 189 { true, ui::VKEY_BRIGHTNESS_DOWN, ui::EF_CONTROL_DOWN, 190 MAGNIFY_SCREEN_ZOOM_OUT}, 191 { true, ui::VKEY_BRIGHTNESS_UP, ui::EF_CONTROL_DOWN, MAGNIFY_SCREEN_ZOOM_IN}, 192 // Extra shortcuts to lock the screen on linux desktop. 193 { true, ui::VKEY_L, ui::EF_ALT_DOWN, LOCK_SCREEN }, 194 { true, ui::VKEY_POWER, ui::EF_SHIFT_DOWN, LOCK_PRESSED }, 195 { false, ui::VKEY_POWER, ui::EF_SHIFT_DOWN, LOCK_RELEASED }, 196 { true, ui::VKEY_D, ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN, 197 ADD_REMOVE_DISPLAY }, 198 { true, ui::VKEY_M, ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN, 199 TOGGLE_MIRROR_MODE }, 200 { true, ui::VKEY_W, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, TOGGLE_WIFI }, 201 // Extra shortcut for display swaping as alt-f4 is taken on linux desktop. 202 { true, ui::VKEY_S, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, 203 SWAP_PRIMARY_DISPLAY }, 204 #endif 205 // Extra shortcut to rotate/scale up/down the screen on linux desktop. 206 { true, ui::VKEY_R, 207 ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, ROTATE_SCREEN }, 208 // For testing on systems where Alt-Tab is already mapped. 209 { true, ui::VKEY_W, ui::EF_ALT_DOWN, CYCLE_FORWARD_MRU }, 210 211 { true, ui::VKEY_F11, ui::EF_CONTROL_DOWN, TOGGLE_ROOT_WINDOW_FULL_SCREEN }, 212 { true, ui::VKEY_W, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN, 213 CYCLE_BACKWARD_MRU }, 214 { true, ui::VKEY_B, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, 215 TOGGLE_DESKTOP_BACKGROUND_MODE }, 216 { true, ui::VKEY_F, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, 217 TOGGLE_FULLSCREEN }, 218 }; 219 220 const size_t kDesktopAcceleratorDataLength = arraysize(kDesktopAcceleratorData); 221 #endif 222 223 const AcceleratorData kDebugAcceleratorData[] = { 224 { true, ui::VKEY_L, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, 225 PRINT_LAYER_HIERARCHY }, 226 { true, ui::VKEY_V, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, 227 PRINT_VIEW_HIERARCHY }, 228 { true, ui::VKEY_W, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, 229 PRINT_WINDOW_HIERARCHY }, 230 { true, ui::VKEY_S, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, 231 DEBUG_TOGGLE_DEVICE_SCALE_FACTOR }, 232 { true, ui::VKEY_B, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, 233 DEBUG_TOGGLE_SHOW_DEBUG_BORDERS }, 234 { true, ui::VKEY_F, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, 235 DEBUG_TOGGLE_SHOW_FPS_COUNTER }, 236 { true, ui::VKEY_P, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, 237 DEBUG_TOGGLE_SHOW_PAINT_RECTS }, 238 }; 239 240 const size_t kDebugAcceleratorDataLength = arraysize(kDebugAcceleratorData); 241 242 const AcceleratorAction kReservedActions[] = { 243 // Window cycling accelerators. 244 CYCLE_BACKWARD_MRU, // Shift+Alt+Tab 245 CYCLE_FORWARD_MRU, // Alt+Tab 246 #if defined(OS_CHROMEOS) 247 POWER_PRESSED, 248 POWER_RELEASED, 249 #endif 250 }; 251 252 const size_t kReservedActionsLength = arraysize(kReservedActions); 253 254 const AcceleratorAction kReservedDebugActions[] = { 255 PRINT_LAYER_HIERARCHY, 256 PRINT_VIEW_HIERARCHY, 257 PRINT_WINDOW_HIERARCHY, 258 DEBUG_TOGGLE_DEVICE_SCALE_FACTOR, 259 DEBUG_TOGGLE_SHOW_DEBUG_BORDERS, 260 DEBUG_TOGGLE_SHOW_FPS_COUNTER, 261 DEBUG_TOGGLE_SHOW_PAINT_RECTS, 262 }; 263 264 const size_t kReservedDebugActionsLength = arraysize(kReservedDebugActions); 265 266 const AcceleratorAction kActionsAllowedAtLoginOrLockScreen[] = { 267 BRIGHTNESS_DOWN, 268 BRIGHTNESS_UP, 269 DISABLE_CAPS_LOCK, 270 KEYBOARD_BRIGHTNESS_DOWN, 271 KEYBOARD_BRIGHTNESS_UP, 272 MAGNIFY_SCREEN_ZOOM_IN, // Control+F7 273 MAGNIFY_SCREEN_ZOOM_OUT, // Control+F6 274 NEXT_IME, 275 PREVIOUS_IME, 276 PRINT_LAYER_HIERARCHY, 277 PRINT_UI_HIERARCHIES, 278 PRINT_VIEW_HIERARCHY, 279 PRINT_WINDOW_HIERARCHY, 280 ROTATE_WINDOW, 281 SHOW_SYSTEM_TRAY_BUBBLE, 282 SWITCH_IME, // Switch to another IME depending on the accelerator. 283 TAKE_PARTIAL_SCREENSHOT, 284 TAKE_SCREENSHOT, 285 TOGGLE_CAPS_LOCK, 286 TOGGLE_WIFI, 287 TOUCH_HUD_CLEAR, 288 VOLUME_DOWN, 289 VOLUME_MUTE, 290 VOLUME_UP, 291 #if defined(OS_CHROMEOS) 292 TOGGLE_TOUCH_VIEW_TESTING, 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) 302 }; 303 304 const size_t kActionsAllowedAtLoginOrLockScreenLength = 305 arraysize(kActionsAllowedAtLoginOrLockScreen); 306 307 const AcceleratorAction kActionsAllowedAtLockScreen[] = { 308 EXIT, 309 }; 310 311 const size_t kActionsAllowedAtLockScreenLength = 312 arraysize(kActionsAllowedAtLockScreen); 313 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 ROTATE_SCREEN, 333 SCALE_UI_UP, 334 SCALE_UI_DOWN, 335 SCALE_UI_RESET, 336 SHOW_KEYBOARD_OVERLAY, 337 SWITCH_IME, 338 TAKE_PARTIAL_SCREENSHOT, 339 TAKE_SCREENSHOT, 340 TOGGLE_CAPS_LOCK, 341 TOGGLE_WIFI, 342 VOLUME_DOWN, 343 VOLUME_MUTE, 344 VOLUME_UP, 345 #if defined(OS_CHROMEOS) 346 SWAP_PRIMARY_DISPLAY, 347 TOGGLE_SPOKEN_FEEDBACK, 348 #if !defined(NDEBUG) 349 ADD_REMOVE_DISPLAY, 350 #endif 351 LOCK_SCREEN, 352 TOGGLE_MIRROR_MODE, 353 #endif 354 }; 355 356 const size_t kActionsAllowedAtModalWindowLength = 357 arraysize(kActionsAllowedAtModalWindow); 358 359 const AcceleratorAction kNonrepeatableActions[] = { 360 // TODO(mazda): Add other actions which should not be repeated. 361 CYCLE_BACKWARD_MRU, 362 CYCLE_FORWARD_MRU, 363 TOGGLE_OVERVIEW, 364 EXIT, 365 PRINT_UI_HIERARCHIES, // Don't fill the logs if the key is held down. 366 ROTATE_SCREEN, 367 ROTATE_WINDOW, 368 SCALE_UI_UP, 369 SCALE_UI_DOWN, 370 SCALE_UI_RESET, 371 TOGGLE_FULLSCREEN, 372 TOGGLE_MAXIMIZED, 373 WINDOW_MINIMIZE, 374 }; 375 376 const size_t kNonrepeatableActionsLength = 377 arraysize(kNonrepeatableActions); 378 379 const AcceleratorAction kActionsAllowedInAppMode[] = { 380 BRIGHTNESS_DOWN, 381 BRIGHTNESS_UP, 382 DISABLE_CAPS_LOCK, 383 KEYBOARD_BRIGHTNESS_DOWN, 384 KEYBOARD_BRIGHTNESS_UP, 385 MAGNIFY_SCREEN_ZOOM_IN, // Control+F7 386 MAGNIFY_SCREEN_ZOOM_OUT, // Control+F6 387 MEDIA_NEXT_TRACK, 388 MEDIA_PLAY_PAUSE, 389 MEDIA_PREV_TRACK, 390 NEXT_IME, 391 POWER_PRESSED, 392 POWER_RELEASED, 393 PREVIOUS_IME, 394 PRINT_LAYER_HIERARCHY, 395 PRINT_UI_HIERARCHIES, 396 PRINT_VIEW_HIERARCHY, 397 PRINT_WINDOW_HIERARCHY, 398 ROTATE_SCREEN, 399 SCALE_UI_DOWN, 400 SCALE_UI_RESET, 401 SCALE_UI_UP, 402 SWITCH_IME, // Switch to another IME depending on the accelerator. 403 TOGGLE_CAPS_LOCK, 404 TOGGLE_WIFI, 405 TOUCH_HUD_CLEAR, 406 VOLUME_DOWN, 407 VOLUME_MUTE, 408 VOLUME_UP, 409 #if defined(OS_CHROMEOS) 410 SWAP_PRIMARY_DISPLAY, 411 TOGGLE_SPOKEN_FEEDBACK, 412 ADD_REMOVE_DISPLAY, 413 DISABLE_GPU_WATCHDOG, 414 TOGGLE_MIRROR_MODE, 415 #endif // defined(OS_CHROMEOS) 416 }; 417 418 const size_t kActionsAllowedInAppModeLength = 419 arraysize(kActionsAllowedInAppMode); 420 421 const AcceleratorAction kActionsNeedingWindow[] = { 422 ACCESSIBLE_FOCUS_NEXT, 423 ACCESSIBLE_FOCUS_PREVIOUS, 424 CYCLE_BACKWARD_MRU, 425 CYCLE_FORWARD_MRU, 426 TOGGLE_OVERVIEW, 427 WINDOW_SNAP_LEFT, 428 WINDOW_SNAP_RIGHT, 429 WINDOW_MINIMIZE, 430 TOGGLE_FULLSCREEN, 431 TOGGLE_MAXIMIZED, 432 WINDOW_POSITION_CENTER, 433 ROTATE_WINDOW, 434 }; 435 436 const size_t kActionsNeedingWindowLength = arraysize(kActionsNeedingWindow); 437 438 } // namespace ash 439