bump product version to 7.6.3.2-android
[LibreOffice.git] / include / vcl / keycodes.hxx
bloba935b0ee046025f84fa463551b17beb46e38c50a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_VCL_KEYCODES_HXX
21 #define INCLUDED_VCL_KEYCODES_HXX
23 #include <com/sun/star/awt/Key.hpp>
24 #include <com/sun/star/awt/KeyGroup.hpp>
25 #include <o3tl/typed_flags_set.hxx>
27 constexpr sal_uInt16 KEY_CODE_MASK = 0x0FFF;
29 // Modifier keys
30 constexpr sal_uInt16 KEY_SHIFT = 0x1000;
31 constexpr sal_uInt16 KEY_MOD1 = 0x2000;
32 constexpr sal_uInt16 KEY_MOD2 = 0x4000;
33 constexpr sal_uInt16 KEY_MOD3 = 0x8000;
34 constexpr sal_uInt16 KEY_MODIFIERS_MASK = 0xF000;
36 // Key groups
37 constexpr sal_uInt16 KEYGROUP_NUM = css::awt::KeyGroup::NUM;
38 constexpr sal_uInt16 KEYGROUP_ALPHA = css::awt::KeyGroup::ALPHA;
39 constexpr sal_uInt16 KEYGROUP_FKEYS = css::awt::KeyGroup::FKEYS;
40 constexpr sal_uInt16 KEYGROUP_CURSOR = css::awt::KeyGroup::CURSOR;
41 constexpr sal_uInt16 KEYGROUP_MISC = css::awt::KeyGroup::MISC;
42 constexpr sal_uInt16 KEYGROUP_TYPE = css::awt::KeyGroup::TYPE;
44 // Key codes
45 constexpr sal_uInt16 KEY_0 = css::awt::Key::NUM0;
46 constexpr sal_uInt16 KEY_1 = css::awt::Key::NUM1;
47 constexpr sal_uInt16 KEY_2 = css::awt::Key::NUM2;
48 constexpr sal_uInt16 KEY_3 = css::awt::Key::NUM3;
49 constexpr sal_uInt16 KEY_4 = css::awt::Key::NUM4;
50 constexpr sal_uInt16 KEY_5 = css::awt::Key::NUM5;
51 constexpr sal_uInt16 KEY_6 = css::awt::Key::NUM6;
52 constexpr sal_uInt16 KEY_7 = css::awt::Key::NUM7;
53 constexpr sal_uInt16 KEY_8 = css::awt::Key::NUM8;
54 constexpr sal_uInt16 KEY_9 = css::awt::Key::NUM9;
56 constexpr sal_uInt16 KEY_A = css::awt::Key::A;
57 constexpr sal_uInt16 KEY_B = css::awt::Key::B;
58 constexpr sal_uInt16 KEY_C = css::awt::Key::C;
59 constexpr sal_uInt16 KEY_D = css::awt::Key::D;
60 constexpr sal_uInt16 KEY_E = css::awt::Key::E;
61 constexpr sal_uInt16 KEY_F = css::awt::Key::F;
62 constexpr sal_uInt16 KEY_G = css::awt::Key::G;
63 constexpr sal_uInt16 KEY_H = css::awt::Key::H;
64 constexpr sal_uInt16 KEY_I = css::awt::Key::I;
65 constexpr sal_uInt16 KEY_J = css::awt::Key::J;
66 constexpr sal_uInt16 KEY_K = css::awt::Key::K;
67 constexpr sal_uInt16 KEY_L = css::awt::Key::L;
68 constexpr sal_uInt16 KEY_M = css::awt::Key::M;
69 constexpr sal_uInt16 KEY_N = css::awt::Key::N;
70 constexpr sal_uInt16 KEY_O = css::awt::Key::O;
71 constexpr sal_uInt16 KEY_P = css::awt::Key::P;
72 constexpr sal_uInt16 KEY_Q = css::awt::Key::Q;
73 constexpr sal_uInt16 KEY_R = css::awt::Key::R;
74 constexpr sal_uInt16 KEY_S = css::awt::Key::S;
75 constexpr sal_uInt16 KEY_T = css::awt::Key::T;
76 constexpr sal_uInt16 KEY_U = css::awt::Key::U;
77 constexpr sal_uInt16 KEY_V = css::awt::Key::V;
78 constexpr sal_uInt16 KEY_W = css::awt::Key::W;
79 constexpr sal_uInt16 KEY_X = css::awt::Key::X;
80 constexpr sal_uInt16 KEY_Y = css::awt::Key::Y;
81 constexpr sal_uInt16 KEY_Z = css::awt::Key::Z;
83 constexpr sal_uInt16 KEY_F1 = css::awt::Key::F1;
84 constexpr sal_uInt16 KEY_F2 = css::awt::Key::F2;
85 constexpr sal_uInt16 KEY_F3 = css::awt::Key::F3;
86 constexpr sal_uInt16 KEY_F4 = css::awt::Key::F4;
87 constexpr sal_uInt16 KEY_F5 = css::awt::Key::F5;
88 constexpr sal_uInt16 KEY_F6 = css::awt::Key::F6;
89 constexpr sal_uInt16 KEY_F7 = css::awt::Key::F7;
90 constexpr sal_uInt16 KEY_F8 = css::awt::Key::F8;
91 constexpr sal_uInt16 KEY_F9 = css::awt::Key::F9;
92 constexpr sal_uInt16 KEY_F10 = css::awt::Key::F10;
93 constexpr sal_uInt16 KEY_F11 = css::awt::Key::F11;
94 constexpr sal_uInt16 KEY_F12 = css::awt::Key::F12;
95 constexpr sal_uInt16 KEY_F13 = css::awt::Key::F13;
96 constexpr sal_uInt16 KEY_F14 = css::awt::Key::F14;
97 constexpr sal_uInt16 KEY_F15 = css::awt::Key::F15;
98 constexpr sal_uInt16 KEY_F16 = css::awt::Key::F16;
99 constexpr sal_uInt16 KEY_F17 = css::awt::Key::F17;
100 constexpr sal_uInt16 KEY_F18 = css::awt::Key::F18;
101 constexpr sal_uInt16 KEY_F19 = css::awt::Key::F19;
102 constexpr sal_uInt16 KEY_F20 = css::awt::Key::F20;
103 constexpr sal_uInt16 KEY_F21 = css::awt::Key::F21;
104 constexpr sal_uInt16 KEY_F22 = css::awt::Key::F22;
105 constexpr sal_uInt16 KEY_F23 = css::awt::Key::F23;
106 constexpr sal_uInt16 KEY_F24 = css::awt::Key::F24;
107 constexpr sal_uInt16 KEY_F25 = css::awt::Key::F25;
108 constexpr sal_uInt16 KEY_F26 = css::awt::Key::F26;
110 constexpr sal_uInt16 KEY_DOWN = css::awt::Key::DOWN;
111 constexpr sal_uInt16 KEY_UP = css::awt::Key::UP;
112 constexpr sal_uInt16 KEY_LEFT = css::awt::Key::LEFT;
113 constexpr sal_uInt16 KEY_RIGHT = css::awt::Key::RIGHT;
114 constexpr sal_uInt16 KEY_HOME = css::awt::Key::HOME;
115 constexpr sal_uInt16 KEY_END = css::awt::Key::END;
116 constexpr sal_uInt16 KEY_PAGEUP = css::awt::Key::PAGEUP;
117 constexpr sal_uInt16 KEY_PAGEDOWN = css::awt::Key::PAGEDOWN;
119 constexpr sal_uInt16 KEY_RETURN = css::awt::Key::RETURN;
120 constexpr sal_uInt16 KEY_ESCAPE = css::awt::Key::ESCAPE;
121 constexpr sal_uInt16 KEY_TAB = css::awt::Key::TAB;
122 constexpr sal_uInt16 KEY_BACKSPACE = css::awt::Key::BACKSPACE;
123 constexpr sal_uInt16 KEY_SPACE = css::awt::Key::SPACE;
124 constexpr sal_uInt16 KEY_INSERT = css::awt::Key::INSERT;
125 constexpr sal_uInt16 KEY_DELETE = css::awt::Key::DELETE;
127 constexpr sal_uInt16 KEY_ADD = css::awt::Key::ADD;
128 constexpr sal_uInt16 KEY_SUBTRACT = css::awt::Key::SUBTRACT;
129 constexpr sal_uInt16 KEY_MULTIPLY = css::awt::Key::MULTIPLY;
130 constexpr sal_uInt16 KEY_DIVIDE = css::awt::Key::DIVIDE;
131 constexpr sal_uInt16 KEY_POINT = css::awt::Key::POINT;
132 constexpr sal_uInt16 KEY_COMMA = css::awt::Key::COMMA;
133 constexpr sal_uInt16 KEY_LESS = css::awt::Key::LESS;
134 constexpr sal_uInt16 KEY_GREATER = css::awt::Key::GREATER;
135 constexpr sal_uInt16 KEY_EQUAL = css::awt::Key::EQUAL;
137 constexpr sal_uInt16 KEY_OPEN = css::awt::Key::OPEN;
138 constexpr sal_uInt16 KEY_CUT = css::awt::Key::CUT;
139 constexpr sal_uInt16 KEY_COPY = css::awt::Key::COPY;
140 constexpr sal_uInt16 KEY_PASTE = css::awt::Key::PASTE;
141 constexpr sal_uInt16 KEY_UNDO = css::awt::Key::UNDO;
142 constexpr sal_uInt16 KEY_REPEAT = css::awt::Key::REPEAT;
143 constexpr sal_uInt16 KEY_FIND = css::awt::Key::FIND;
144 constexpr sal_uInt16 KEY_PROPERTIES = css::awt::Key::PROPERTIES;
145 constexpr sal_uInt16 KEY_FRONT = css::awt::Key::FRONT;
146 constexpr sal_uInt16 KEY_CONTEXTMENU = css::awt::Key::CONTEXTMENU;
147 constexpr sal_uInt16 KEY_MENU = css::awt::Key::MENU;
148 constexpr sal_uInt16 KEY_HELP = css::awt::Key::HELP;
149 constexpr sal_uInt16 KEY_HANGUL_HANJA = css::awt::Key::HANGUL_HANJA;
150 constexpr sal_uInt16 KEY_DECIMAL = css::awt::Key::DECIMAL;
151 constexpr sal_uInt16 KEY_TILDE = css::awt::Key::TILDE;
152 constexpr sal_uInt16 KEY_QUOTELEFT = css::awt::Key::QUOTELEFT;
153 constexpr sal_uInt16 KEY_BRACKETLEFT = css::awt::Key::BRACKETLEFT;
154 constexpr sal_uInt16 KEY_BRACKETRIGHT = css::awt::Key::BRACKETRIGHT;
155 constexpr sal_uInt16 KEY_SEMICOLON = css::awt::Key::SEMICOLON;
156 constexpr sal_uInt16 KEY_QUOTERIGHT = css::awt::Key::QUOTERIGHT;
157 constexpr sal_uInt16 KEY_RIGHTCURLYBRACKET = css::awt::Key::RIGHTCURLYBRACKET;
158 constexpr sal_uInt16 KEY_COLON = css::awt::Key::COLON;
160 constexpr sal_uInt16 KEY_CAPSLOCK = css::awt::Key::CAPSLOCK;
161 constexpr sal_uInt16 KEY_NUMLOCK = css::awt::Key::NUMLOCK;
162 constexpr sal_uInt16 KEY_SCROLLLOCK = css::awt::Key::SCROLLLOCK;
164 // extended Modifier-Keys (only used for modkey events)
165 enum class ModKeyFlags
167 NONE = 0x0000,
168 LeftShift = 0x0001,
169 RightShift = 0x0002,
170 LeftMod1 = 0x0004,
171 RightMod1 = 0x0008,
172 LeftMod2 = 0x0010,
173 RightMod2 = 0x0020,
174 LeftMod3 = 0x0040,
175 RightMod3 = 0x0080,
176 Mod1Msk = LeftMod1 | RightMod1, // should be Mod1Mask, but that conflicts with a X.h macro grrrr
177 Mod2Msk = LeftMod2 | RightMod2,
179 namespace o3tl
181 template <> struct typed_flags<ModKeyFlags> : is_typed_flags<ModKeyFlags, 0x00ff>
186 enum class KeyIndicatorState
188 NONE = 0x0000,
189 CAPSLOCK = 0x0001,
190 NUMLOCK = 0x0002,
191 SCROLLLOCK = 0x0004
193 namespace o3tl
195 template <> struct typed_flags<KeyIndicatorState> : is_typed_flags<KeyIndicatorState, 0x0007>
200 #endif // INCLUDED_VCL_KEYCODES_HXX
202 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */