summaryrefslogtreecommitdiffstats
path: root/ash/accelerators/accelerator_table.h
blob: 25b118ea78269acac9874f58063ca9035b45939c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef ASH_ACCELERATORS_ACCELERATOR_TABLE_H_
#define ASH_ACCELERATORS_ACCELERATOR_TABLE_H_
#pragma once

#include "ash/ash_export.h"
#include "ui/aura/event.h"

namespace ash {

// Please put if/def sections at the end of the bare section and keep the list
// within each section in alphabetical order.
enum AcceleratorAction {
  BRIGHTNESS_DOWN,
  BRIGHTNESS_UP,
  CYCLE_BACKWARD_LINEAR,
  CYCLE_BACKWARD_MRU,
  CYCLE_FORWARD_LINEAR,
  CYCLE_FORWARD_MRU,
  EXIT,
  FOCUS_LAUNCHER,
  FOCUS_NEXT_PANE,
  FOCUS_PREVIOUS_PANE,
  FOCUS_SYSTEM_TRAY,
  NEW_INCOGNITO_WINDOW,
  NEW_TAB,
  NEW_WINDOW,
  NEXT_IME,
  PREVIOUS_IME,
  RESTORE_TAB,
  ROTATE_WINDOWS,
  SELECT_LAST_WIN,
  SELECT_WIN_0,
  SELECT_WIN_1,
  SELECT_WIN_2,
  SELECT_WIN_3,
  SELECT_WIN_4,
  SELECT_WIN_5,
  SELECT_WIN_6,
  SELECT_WIN_7,
  SHOW_KEYBOARD_OVERLAY,
  SHOW_OAK,
  SHOW_TASK_MANAGER,
  SWITCH_IME,  // Switch to another IME depending on the accelerator.
  TAKE_PARTIAL_SCREENSHOT,
  TAKE_SCREENSHOT,
  TOGGLE_APP_LIST,
  TOGGLE_CAPS_LOCK,
  TOGGLE_SPOKEN_FEEDBACK,
  VOLUME_DOWN,
  VOLUME_MUTE,
  VOLUME_UP,
  WINDOW_MAXIMIZE_RESTORE,
  WINDOW_MINIMIZE,
  WINDOW_POSITION_CENTER,
  WINDOW_SNAP_LEFT,
  WINDOW_SNAP_RIGHT,
#if defined(OS_CHROMEOS)
  CYCLE_DISPLAY_MODE,
  LOCK_SCREEN,
  OPEN_CROSH,
  OPEN_FILE_MANAGER_DIALOG,
  OPEN_FILE_MANAGER_TAB,
#endif
  MONITOR_ADD_REMOVE,
  MONITOR_CYCLE,
  MONITOR_TOGGLE_SCALE,
  ROTATE_SCREEN,
  TOGGLE_DESKTOP_BACKGROUND_MODE,
  TOGGLE_ROOT_WINDOW_FULL_SCREEN,
#if !defined(NDEBUG)
  PRINT_LAYER_HIERARCHY,
  PRINT_WINDOW_HIERARCHY,
#endif
};

struct AcceleratorData {
  bool trigger_on_press;
  ui::KeyboardCode keycode;
  int modifiers;
  AcceleratorAction action;
};

// Accelerators handled by AcceleratorController.
ASH_EXPORT extern const AcceleratorData kAcceleratorData[];

// The number of elements in kAcceleratorData.
ASH_EXPORT extern const size_t kAcceleratorDataLength;

// Actions that should be handled very early in Ash unless the current target
// window is full-screen.
ASH_EXPORT extern const AcceleratorAction kReservedActions[];

// The number of elements in kReservedActions.
ASH_EXPORT extern const size_t kReservedActionsLength;

// Actions allowed while user is not signed in or screen is locked.
ASH_EXPORT extern const AcceleratorAction kActionsAllowedAtLoginOrLockScreen[];

// The number of elements in kActionsAllowedAtLoginOrLockScreen.
ASH_EXPORT extern const size_t kActionsAllowedAtLoginOrLockScreenLength;

// Actions allowed while screen is locked (in addition to
// kActionsAllowedAtLoginOrLockScreen).
ASH_EXPORT extern const AcceleratorAction kActionsAllowedAtLockScreen[];

// The number of elements in kActionsAllowedAtLockScreen.
ASH_EXPORT extern const size_t kActionsAllowedAtLockScreenLength;

}  // namespace ash

#endif  // ASH_ACCELERATORS_ACCELERATOR_TABLE_H_