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 #ifndef ASH_ACCELERATORS_ACCELERATOR_TABLE_H_
6 #define ASH_ACCELERATORS_ACCELERATOR_TABLE_H_
8 #include "ash/ash_export.h"
9 #include "base/basictypes.h"
10 #include "ui/base/events/event_constants.h"
11 #include "ui/base/keycodes/keyboard_codes.h"
15 // Please put if/def sections at the end of the bare section and keep the list
16 // within each section in alphabetical order.
17 enum AcceleratorAction
{
20 CYCLE_BACKWARD_LINEAR
,
30 KEYBOARD_BRIGHTNESS_DOWN
,
31 KEYBOARD_BRIGHTNESS_UP
,
34 MAGNIFY_SCREEN_ZOOM_IN
,
35 MAGNIFY_SCREEN_ZOOM_OUT
,
59 SHOW_KEYBOARD_OVERLAY
,
61 SHOW_SYSTEM_TRAY_BUBBLE
,
64 SWITCH_IME
, // Switch to another IME depending on the accelerator.
65 TAKE_PARTIAL_SCREENSHOT
,
69 TOGGLE_CAPS_LOCK_BY_ALT_LWIN
,
70 TOGGLE_DESKTOP_BACKGROUND_MODE
,
72 TOGGLE_ROOT_WINDOW_FULL_SCREEN
,
73 TOGGLE_SPOKEN_FEEDBACK
,
79 WINDOW_POSITION_CENTER
,
82 #if defined(OS_CHROMEOS)
86 OPEN_FILE_MANAGER_DIALOG
,
87 OPEN_FILE_MANAGER_TAB
,
91 PRINT_LAYER_HIERARCHY
,
93 PRINT_WINDOW_HIERARCHY
,
97 struct AcceleratorData
{
98 bool trigger_on_press
;
99 ui::KeyboardCode keycode
;
101 AcceleratorAction action
;
104 // Accelerators handled by AcceleratorController.
105 ASH_EXPORT
extern const AcceleratorData kAcceleratorData
[];
107 // The number of elements in kAcceleratorData.
108 ASH_EXPORT
extern const size_t kAcceleratorDataLength
;
110 // Debug accelerators enabled only when "Debugging keyboard shortcuts" flag
111 // (--ash-debug-shortcuts) is enabled.
112 ASH_EXPORT
extern const AcceleratorData kDebugAcceleratorData
[];
114 // The number of elements in kDebugAcceleratorData.
115 ASH_EXPORT
extern const size_t kDebugAcceleratorDataLength
;
117 // Actions that should be handled very early in Ash unless the current target
118 // window is full-screen.
119 ASH_EXPORT
extern const AcceleratorAction kReservedActions
[];
121 // The number of elements in kReservedActions.
122 ASH_EXPORT
extern const size_t kReservedActionsLength
;
124 // Actions allowed while user is not signed in or screen is locked.
125 ASH_EXPORT
extern const AcceleratorAction kActionsAllowedAtLoginOrLockScreen
[];
127 // The number of elements in kActionsAllowedAtLoginOrLockScreen.
128 ASH_EXPORT
extern const size_t kActionsAllowedAtLoginOrLockScreenLength
;
130 // Actions allowed while screen is locked (in addition to
131 // kActionsAllowedAtLoginOrLockScreen).
132 ASH_EXPORT
extern const AcceleratorAction kActionsAllowedAtLockScreen
[];
134 // The number of elements in kActionsAllowedAtLockScreen.
135 ASH_EXPORT
extern const size_t kActionsAllowedAtLockScreenLength
;
137 // Actions allowed while a modal window is up.
138 ASH_EXPORT
extern const AcceleratorAction kActionsAllowedAtModalWindow
[];
140 // The number of elements in kActionsAllowedAtModalWindow.
141 ASH_EXPORT
extern const size_t kActionsAllowedAtModalWindowLength
;
143 // Actions which will not be repeated while holding an accelerator key.
144 ASH_EXPORT
extern const AcceleratorAction kNonrepeatableActions
[];
146 // The number of elements in kNonrepeatableActions.
147 ASH_EXPORT
extern const size_t kNonrepeatableActionsLength
;
151 #endif // ASH_ACCELERATORS_ACCELERATOR_TABLE_H_