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
{
18 ACCESSIBLE_FOCUS_NEXT
,
19 ACCESSIBLE_FOCUS_PREVIOUS
,
22 CYCLE_BACKWARD_LINEAR
,
26 DEBUG_TOGGLE_DEVICE_SCALE_FACTOR
,
27 DEBUG_TOGGLE_SHOW_DEBUG_BORDERS
,
28 DEBUG_TOGGLE_SHOW_FPS_COUNTER
,
29 DEBUG_TOGGLE_SHOW_PAINT_RECTS
,
35 KEYBOARD_BRIGHTNESS_DOWN
,
36 KEYBOARD_BRIGHTNESS_UP
,
48 MAGNIFY_SCREEN_ZOOM_IN
,
49 MAGNIFY_SCREEN_ZOOM_OUT
,
61 PRINT_LAYER_HIERARCHY
,
64 PRINT_WINDOW_HIERARCHY
,
71 SHOW_KEYBOARD_OVERLAY
,
72 SHOW_MESSAGE_CENTER_BUBBLE
,
74 SHOW_SYSTEM_TRAY_BUBBLE
,
76 SILENCE_SPOKEN_FEEDBACK
,
78 SWITCH_IME
, // Switch to another IME depending on the accelerator.
79 TAKE_PARTIAL_SCREENSHOT
,
83 TOGGLE_CAPS_LOCK_BY_ALT_LWIN
,
84 TOGGLE_DESKTOP_BACKGROUND_MODE
,
87 TOGGLE_ROOT_WINDOW_FULL_SCREEN
,
88 TOGGLE_SPOKEN_FEEDBACK
,
91 TOUCH_HUD_MODE_CHANGE
,
92 TOUCH_HUD_PROJECTION_TOGGLE
,
97 WINDOW_POSITION_CENTER
,
100 #if defined(OS_CHROMEOS)
103 DISABLE_GPU_WATCHDOG
,
106 OPEN_FILE_DIALOG
, // Open 'Open file' dialog.
111 struct AcceleratorData
{
112 bool trigger_on_press
;
113 ui::KeyboardCode keycode
;
115 AcceleratorAction action
;
118 // Accelerators handled by AcceleratorController.
119 ASH_EXPORT
extern const AcceleratorData kAcceleratorData
[];
121 // The number of elements in kAcceleratorData.
122 ASH_EXPORT
extern const size_t kAcceleratorDataLength
;
125 // Accelerators useful when running on desktop. Debug build only.
126 ASH_EXPORT
extern const AcceleratorData kDesktopAcceleratorData
[];
128 // The number of elements in kDesktopAcceleratorData.
129 ASH_EXPORT
extern const size_t kDesktopAcceleratorDataLength
;
132 // Debug accelerators enabled only when "Debugging keyboard shortcuts" flag
133 // (--ash-debug-shortcuts) is enabled.
134 ASH_EXPORT
extern const AcceleratorData kDebugAcceleratorData
[];
136 // The number of elements in kDebugAcceleratorData.
137 ASH_EXPORT
extern const size_t kDebugAcceleratorDataLength
;
139 // Actions that should be handled very early in Ash unless the current target
140 // window is full-screen.
141 ASH_EXPORT
extern const AcceleratorAction kReservedActions
[];
143 // The number of elements in kReservedActions.
144 ASH_EXPORT
extern const size_t kReservedActionsLength
;
146 // Actions that should be handled very early in Ash unless the current target
147 // window is full-screen, these actions are only handled if
148 // DebugShortcutsEnabled is true (command line switch 'ash-debug-shortcuts').
149 ASH_EXPORT
extern const AcceleratorAction kReservedDebugActions
[];
151 // The number of elements in kReservedDebugActions.
152 ASH_EXPORT
extern const size_t kReservedDebugActionsLength
;
154 // Actions allowed while user is not signed in or screen is locked.
155 ASH_EXPORT
extern const AcceleratorAction kActionsAllowedAtLoginOrLockScreen
[];
157 // The number of elements in kActionsAllowedAtLoginOrLockScreen.
158 ASH_EXPORT
extern const size_t kActionsAllowedAtLoginOrLockScreenLength
;
160 // Actions allowed while screen is locked (in addition to
161 // kActionsAllowedAtLoginOrLockScreen).
162 ASH_EXPORT
extern const AcceleratorAction kActionsAllowedAtLockScreen
[];
164 // The number of elements in kActionsAllowedAtLockScreen.
165 ASH_EXPORT
extern const size_t kActionsAllowedAtLockScreenLength
;
167 // Actions allowed while a modal window is up.
168 ASH_EXPORT
extern const AcceleratorAction kActionsAllowedAtModalWindow
[];
170 // The number of elements in kActionsAllowedAtModalWindow.
171 ASH_EXPORT
extern const size_t kActionsAllowedAtModalWindowLength
;
173 // Actions which will not be repeated while holding an accelerator key.
174 ASH_EXPORT
extern const AcceleratorAction kNonrepeatableActions
[];
176 // The number of elements in kNonrepeatableActions.
177 ASH_EXPORT
extern const size_t kNonrepeatableActionsLength
;
179 // Actions allowed in app mode.
180 ASH_EXPORT
extern const AcceleratorAction kActionsAllowedInAppMode
[];
182 // The number of elements in kActionsAllowedInAppMode.
183 ASH_EXPORT
extern const size_t kActionsAllowedInAppModeLength
;
187 #endif // ASH_ACCELERATORS_ACCELERATOR_TABLE_H_