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
,
90 PRINT_LAYER_HIERARCHY
,
92 PRINT_WINDOW_HIERARCHY
,
96 struct AcceleratorData
{
97 bool trigger_on_press
;
98 ui::KeyboardCode keycode
;
100 AcceleratorAction action
;
103 // Accelerators handled by AcceleratorController.
104 ASH_EXPORT
extern const AcceleratorData kAcceleratorData
[];
106 // The number of elements in kAcceleratorData.
107 ASH_EXPORT
extern const size_t kAcceleratorDataLength
;
109 // Debug accelerators enabled only when "Debugging keyboard shortcuts" flag
110 // (--ash-debug-shortcuts) is enabled.
111 ASH_EXPORT
extern const AcceleratorData kDebugAcceleratorData
[];
113 // The number of elements in kDebugAcceleratorData.
114 ASH_EXPORT
extern const size_t kDebugAcceleratorDataLength
;
116 // Actions that should be handled very early in Ash unless the current target
117 // window is full-screen.
118 ASH_EXPORT
extern const AcceleratorAction kReservedActions
[];
120 // The number of elements in kReservedActions.
121 ASH_EXPORT
extern const size_t kReservedActionsLength
;
123 // Actions allowed while user is not signed in or screen is locked.
124 ASH_EXPORT
extern const AcceleratorAction kActionsAllowedAtLoginOrLockScreen
[];
126 // The number of elements in kActionsAllowedAtLoginOrLockScreen.
127 ASH_EXPORT
extern const size_t kActionsAllowedAtLoginOrLockScreenLength
;
129 // Actions allowed while screen is locked (in addition to
130 // kActionsAllowedAtLoginOrLockScreen).
131 ASH_EXPORT
extern const AcceleratorAction kActionsAllowedAtLockScreen
[];
133 // The number of elements in kActionsAllowedAtLockScreen.
134 ASH_EXPORT
extern const size_t kActionsAllowedAtLockScreenLength
;
136 // Actions allowed while a modal window is up.
137 ASH_EXPORT
extern const AcceleratorAction kActionsAllowedAtModalWindow
[];
139 // The number of elements in kActionsAllowedAtModalWindow.
140 ASH_EXPORT
extern const size_t kActionsAllowedAtModalWindowLength
;
142 // Actions which will not be repeated while holding an accelerator key.
143 ASH_EXPORT
extern const AcceleratorAction kNonrepeatableActions
[];
145 // The number of elements in kNonrepeatableActions.
146 ASH_EXPORT
extern const size_t kNonrepeatableActionsLength
;
150 #endif // ASH_ACCELERATORS_ACCELERATOR_TABLE_H_