Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / vcl / keycodes.hxx
blob5356c203a18792d7808c1a4b0190a382802cf393
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 <rsc/rsc-vcl-shared-types.hxx>
24 #undef DELETE
25 #include <com/sun/star/awt/Key.hpp>
26 #include <com/sun/star/awt/KeyGroup.hpp>
27 #include <o3tl/typed_flags_set.hxx>
29 // Key-Gruppen
30 #define KEYGROUP_NUM ((sal_uInt16)css::awt::KeyGroup::NUM)
31 #define KEYGROUP_ALPHA ((sal_uInt16)css::awt::KeyGroup::ALPHA)
32 #define KEYGROUP_FKEYS ((sal_uInt16)css::awt::KeyGroup::FKEYS)
33 #define KEYGROUP_CURSOR ((sal_uInt16)css::awt::KeyGroup::CURSOR)
34 #define KEYGROUP_MISC ((sal_uInt16)css::awt::KeyGroup::MISC)
35 #define KEYGROUP_TYPE ((sal_uInt16)css::awt::KeyGroup::TYPE)
37 // Key-Codes
38 #define KEY_0 ((sal_uInt16)css::awt::Key::NUM0)
39 #define KEY_1 ((sal_uInt16)css::awt::Key::NUM1)
40 #define KEY_2 ((sal_uInt16)css::awt::Key::NUM2)
41 #define KEY_3 ((sal_uInt16)css::awt::Key::NUM3)
42 #define KEY_4 ((sal_uInt16)css::awt::Key::NUM4)
43 #define KEY_5 ((sal_uInt16)css::awt::Key::NUM5)
44 #define KEY_6 ((sal_uInt16)css::awt::Key::NUM6)
45 #define KEY_7 ((sal_uInt16)css::awt::Key::NUM7)
46 #define KEY_8 ((sal_uInt16)css::awt::Key::NUM8)
47 #define KEY_9 ((sal_uInt16)css::awt::Key::NUM9)
49 #define KEY_A ((sal_uInt16)css::awt::Key::A)
50 #define KEY_B ((sal_uInt16)css::awt::Key::B)
51 #define KEY_C ((sal_uInt16)css::awt::Key::C)
52 #define KEY_D ((sal_uInt16)css::awt::Key::D)
53 #define KEY_E ((sal_uInt16)css::awt::Key::E)
54 #define KEY_F ((sal_uInt16)css::awt::Key::F)
55 #define KEY_G ((sal_uInt16)css::awt::Key::G)
56 #define KEY_H ((sal_uInt16)css::awt::Key::H)
57 #define KEY_I ((sal_uInt16)css::awt::Key::I)
58 #define KEY_J ((sal_uInt16)css::awt::Key::J)
59 #define KEY_K ((sal_uInt16)css::awt::Key::K)
60 #define KEY_L ((sal_uInt16)css::awt::Key::L)
61 #define KEY_M ((sal_uInt16)css::awt::Key::M)
62 #define KEY_N ((sal_uInt16)css::awt::Key::N)
63 #define KEY_O ((sal_uInt16)css::awt::Key::O)
64 #define KEY_P ((sal_uInt16)css::awt::Key::P)
65 #define KEY_Q ((sal_uInt16)css::awt::Key::Q)
66 #define KEY_R ((sal_uInt16)css::awt::Key::R)
67 #define KEY_S ((sal_uInt16)css::awt::Key::S)
68 #define KEY_T ((sal_uInt16)css::awt::Key::T)
69 #define KEY_U ((sal_uInt16)css::awt::Key::U)
70 #define KEY_V ((sal_uInt16)css::awt::Key::V)
71 #define KEY_W ((sal_uInt16)css::awt::Key::W)
72 #define KEY_X ((sal_uInt16)css::awt::Key::X)
73 #define KEY_Y ((sal_uInt16)css::awt::Key::Y)
74 #define KEY_Z ((sal_uInt16)css::awt::Key::Z)
76 #define KEY_F1 ((sal_uInt16)css::awt::Key::F1)
77 #define KEY_F2 ((sal_uInt16)css::awt::Key::F2)
78 #define KEY_F3 ((sal_uInt16)css::awt::Key::F3)
79 #define KEY_F4 ((sal_uInt16)css::awt::Key::F4)
80 #define KEY_F5 ((sal_uInt16)css::awt::Key::F5)
81 #define KEY_F6 ((sal_uInt16)css::awt::Key::F6)
82 #define KEY_F7 ((sal_uInt16)css::awt::Key::F7)
83 #define KEY_F8 ((sal_uInt16)css::awt::Key::F8)
84 #define KEY_F9 ((sal_uInt16)css::awt::Key::F9)
85 #define KEY_F10 ((sal_uInt16)css::awt::Key::F10)
86 #define KEY_F11 ((sal_uInt16)css::awt::Key::F11)
87 #define KEY_F12 ((sal_uInt16)css::awt::Key::F12)
88 #define KEY_F13 ((sal_uInt16)css::awt::Key::F13)
89 #define KEY_F14 ((sal_uInt16)css::awt::Key::F14)
90 #define KEY_F15 ((sal_uInt16)css::awt::Key::F15)
91 #define KEY_F16 ((sal_uInt16)css::awt::Key::F16)
92 #define KEY_F17 ((sal_uInt16)css::awt::Key::F17)
93 #define KEY_F18 ((sal_uInt16)css::awt::Key::F18)
94 #define KEY_F19 ((sal_uInt16)css::awt::Key::F19)
95 #define KEY_F20 ((sal_uInt16)css::awt::Key::F20)
96 #define KEY_F21 ((sal_uInt16)css::awt::Key::F21)
97 #define KEY_F22 ((sal_uInt16)css::awt::Key::F22)
98 #define KEY_F23 ((sal_uInt16)css::awt::Key::F23)
99 #define KEY_F24 ((sal_uInt16)css::awt::Key::F24)
100 #define KEY_F25 ((sal_uInt16)css::awt::Key::F25)
101 #define KEY_F26 ((sal_uInt16)css::awt::Key::F26)
103 #define KEY_DOWN ((sal_uInt16)css::awt::Key::DOWN)
104 #define KEY_UP ((sal_uInt16)css::awt::Key::UP)
105 #define KEY_LEFT ((sal_uInt16)css::awt::Key::LEFT)
106 #define KEY_RIGHT ((sal_uInt16)css::awt::Key::RIGHT)
107 #define KEY_HOME ((sal_uInt16)css::awt::Key::HOME)
108 #define KEY_END ((sal_uInt16)css::awt::Key::END)
109 #define KEY_PAGEUP ((sal_uInt16)css::awt::Key::PAGEUP)
110 #define KEY_PAGEDOWN ((sal_uInt16)css::awt::Key::PAGEDOWN)
112 #define KEY_RETURN ((sal_uInt16)css::awt::Key::RETURN)
113 #define KEY_ESCAPE ((sal_uInt16)css::awt::Key::ESCAPE)
114 #define KEY_TAB ((sal_uInt16)css::awt::Key::TAB)
115 #define KEY_BACKSPACE ((sal_uInt16)css::awt::Key::BACKSPACE)
116 #define KEY_SPACE ((sal_uInt16)css::awt::Key::SPACE)
117 #define KEY_INSERT ((sal_uInt16)css::awt::Key::INSERT)
118 #define KEY_DELETE ((sal_uInt16)css::awt::Key::DELETE)
120 #define KEY_ADD ((sal_uInt16)css::awt::Key::ADD)
121 #define KEY_SUBTRACT ((sal_uInt16)css::awt::Key::SUBTRACT)
122 #define KEY_MULTIPLY ((sal_uInt16)css::awt::Key::MULTIPLY)
123 #define KEY_DIVIDE ((sal_uInt16)css::awt::Key::DIVIDE)
124 #define KEY_POINT ((sal_uInt16)css::awt::Key::POINT)
125 #define KEY_COMMA ((sal_uInt16)css::awt::Key::COMMA)
126 #define KEY_LESS ((sal_uInt16)css::awt::Key::LESS)
127 #define KEY_GREATER ((sal_uInt16)css::awt::Key::GREATER)
128 #define KEY_EQUAL ((sal_uInt16)css::awt::Key::EQUAL)
130 #define KEY_OPEN ((sal_uInt16)css::awt::Key::OPEN)
131 #define KEY_CUT ((sal_uInt16)css::awt::Key::CUT)
132 #define KEY_COPY ((sal_uInt16)css::awt::Key::COPY)
133 #define KEY_PASTE ((sal_uInt16)css::awt::Key::PASTE)
134 #define KEY_UNDO ((sal_uInt16)css::awt::Key::UNDO)
135 #define KEY_REPEAT ((sal_uInt16)css::awt::Key::REPEAT)
136 #define KEY_FIND ((sal_uInt16)css::awt::Key::FIND)
137 #define KEY_PROPERTIES ((sal_uInt16)css::awt::Key::PROPERTIES)
138 #define KEY_FRONT ((sal_uInt16)css::awt::Key::FRONT)
139 #define KEY_CONTEXTMENU ((sal_uInt16)css::awt::Key::CONTEXTMENU)
140 #define KEY_MENU ((sal_uInt16)css::awt::Key::MENU)
141 #define KEY_HELP ((sal_uInt16)css::awt::Key::HELP)
142 #define KEY_HANGUL_HANJA ((sal_uInt16)css::awt::Key::HANGUL_HANJA)
143 #define KEY_DECIMAL ((sal_uInt16)css::awt::Key::DECIMAL)
144 #define KEY_TILDE ((sal_uInt16)css::awt::Key::TILDE)
145 #define KEY_QUOTELEFT ((sal_uInt16)css::awt::Key::QUOTELEFT)
146 #define KEY_BRACKETLEFT ((sal_uInt16)css::awt::Key::BRACKETLEFT)
147 #define KEY_BRACKETRIGHT ((sal_uInt16)css::awt::Key::BRACKETRIGHT)
148 #define KEY_SEMICOLON ((sal_uInt16)css::awt::Key::SEMICOLON)
149 #define KEY_QUOTERIGHT ((sal_uInt16)css::awt::Key::QUOTERIGHT)
151 #define KEY_CAPSLOCK ((sal_uInt16)css::awt::Key::CAPSLOCK)
152 #define KEY_NUMLOCK ((sal_uInt16)css::awt::Key::NUMLOCK)
153 #define KEY_SCROLLLOCK ((sal_uInt16)css::awt::Key::SCROLLLOCK)
155 // extended Modifier-Keys (only used for modkey events)
156 enum class ModKeyFlags {
157 NONE = 0x0000,
158 LeftShift = 0x0001,
159 RightShift = 0x0002,
160 LeftMod1 = 0x0004,
161 RightMod1 = 0x0008,
162 LeftMod2 = 0x0010,
163 RightMod2 = 0x0020,
164 LeftMod3 = 0x0040,
165 RightMod3 = 0x0080,
166 Mod1Msk = LeftMod1 | RightMod1, // should be Mod1Mask, but that conflicts with a X.h macro grrrr
167 Mod2Msk = LeftMod2 | RightMod2,
169 namespace o3tl {
170 template<> struct typed_flags<ModKeyFlags> : is_typed_flags<ModKeyFlags, 0x00ff> {};
173 enum class KeyIndicatorState {
174 NONE = 0x0000,
175 CAPSLOCK = 0x0001,
176 NUMLOCK = 0x0002,
177 SCROLLLOCK = 0x0004
179 namespace o3tl
181 template<> struct typed_flags<KeyIndicatorState> : is_typed_flags<KeyIndicatorState, 0x0007> {};
184 #endif // INCLUDED_VCL_KEYCODES_HXX
186 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */