source: mainline/uspace/lib/c/include/io/keycode.h@ cd1e3fc0

Last change on this file since cd1e3fc0 was d7f7a4a, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 3 years ago

Replace some license headers with SPDX identifier

Headers are replaced using tools/transorm-copyright.sh only
when it can be matched verbatim with the license header used
throughout most of the codebase.

  • Property mode set to 100644
File size: 2.5 KB
RevLine 
[fa09449]1/*
[d7f7a4a]2 * SPDX-FileCopyrightText: 2009 Jiri Svoboda
[fa09449]3 *
[d7f7a4a]4 * SPDX-License-Identifier: BSD-3-Clause
[fa09449]5 */
6
7/** @addtogroup libc
[2595dab]8 * @{
[fa09449]9 */
10/** @file
11 */
12
[4805495]13#ifndef _LIBC_IO_KEYCODE_H_
14#define _LIBC_IO_KEYCODE_H_
[fa09449]15
16/** Keycode definitions.
17 *
18 * A keycode identifies a key by its position on the keyboard, rather
19 * than by its label. For human readability, key positions are noted
20 * with the key label on a keyboard with US layout. This label has
21 * nothing to do with the character, that the key produces
22 * -- this is determined by the keymap.
23 *
24 * The keyboard model reflects a standard PC keyboard layout.
25 * Non-standard keyboards need to be mapped to this model in some
26 * logical way. Scancodes are mapped to keycodes with a scanmap.
27 *
28 * For easier mapping to the model and to emphasize the nature of keycodes,
29 * they really are organized here by position, rather than by label.
30 */
[369a5f8]31typedef enum {
[fa09449]32
33 /* Main block row 1 */
34
[f89979b]35 KC_BACKTICK = 1,
[fa09449]36
37 KC_1,
38 KC_2,
39 KC_3,
40 KC_4,
41 KC_5,
42 KC_6,
43 KC_7,
44 KC_8,
45 KC_9,
46 KC_0,
47
48 KC_MINUS,
49 KC_EQUALS,
50 KC_BACKSPACE,
51
52 /* Main block row 2 */
53
54 KC_TAB,
55
56 KC_Q,
57 KC_W,
58 KC_E,
59 KC_R,
60 KC_T,
61 KC_Y,
62 KC_U,
63 KC_I,
64 KC_O,
65 KC_P,
66
67 KC_LBRACKET,
68 KC_RBRACKET,
69
70 /* Main block row 3 */
71
72 KC_CAPS_LOCK,
[a35b458]73
[fa09449]74 KC_A,
75 KC_S,
76 KC_D,
77 KC_F,
78 KC_G,
79 KC_H,
80 KC_J,
81 KC_K,
82 KC_L,
83
84 KC_SEMICOLON,
85 KC_QUOTE,
86 KC_BACKSLASH,
[c072a29]87 KC_HASH,
[fa09449]88
89 KC_ENTER,
90
91 /* Main block row 4 */
92
93 KC_LSHIFT,
94
95 KC_Z,
96 KC_X,
97 KC_C,
98 KC_V,
99 KC_B,
100 KC_N,
101 KC_M,
102
103 KC_COMMA,
104 KC_PERIOD,
105 KC_SLASH,
106
107 KC_RSHIFT,
108
109 /* Main block row 5 */
110
111 KC_LCTRL,
112 KC_LALT,
113 KC_SPACE,
114 KC_RALT,
115 KC_RCTRL,
116
117 /* Function keys block */
118
119 KC_ESCAPE,
120
121 KC_F1,
122 KC_F2,
123 KC_F3,
124 KC_F4,
125 KC_F5,
126 KC_F6,
127 KC_F7,
128 KC_F8,
129 KC_F9,
130 KC_F10,
131 KC_F11,
132 KC_F12,
133
134 KC_PRTSCR,
[c072a29]135 KC_SYSREQ,
[fa09449]136 KC_SCROLL_LOCK,
137 KC_PAUSE,
[c072a29]138 KC_BREAK,
[fa09449]139
140 /* Cursor keys block */
141
142 KC_INSERT,
143 KC_HOME,
144 KC_PAGE_UP,
145
146 KC_DELETE,
147 KC_END,
148 KC_PAGE_DOWN,
149
150 KC_UP,
151 KC_LEFT,
152 KC_DOWN,
153 KC_RIGHT,
154
155 /* Numeric block */
156
157 KC_NUM_LOCK,
158 KC_NSLASH,
159 KC_NTIMES,
160 KC_NMINUS,
161
162 KC_NPLUS,
163 KC_NENTER,
164
165 KC_N7,
166 KC_N8,
167 KC_N9,
168
169 KC_N4,
170 KC_N5,
171 KC_N6,
172
173 KC_N1,
174 KC_N2,
175 KC_N3,
176
177 KC_N0,
178 KC_NPERIOD
[a35b458]179
[fa09449]180} keycode_t;
181
[369a5f8]182typedef enum {
[2595dab]183 KM_LSHIFT = 0x001,
184 KM_RSHIFT = 0x002,
185 KM_LCTRL = 0x004,
186 KM_RCTRL = 0x008,
187 KM_LALT = 0x010,
188 KM_RALT = 0x020,
189 KM_CAPS_LOCK = 0x040,
190 KM_NUM_LOCK = 0x080,
191 KM_SCROLL_LOCK = 0x100,
[a35b458]192
[2595dab]193 KM_SHIFT = KM_LSHIFT | KM_RSHIFT,
194 KM_CTRL = KM_LCTRL | KM_RCTRL,
195 KM_ALT = KM_LALT | KM_RALT
[fa09449]196} keymod_t;
197
198#endif
[2595dab]199
[fa09449]200/** @}
201 */
Note: See TracBrowser for help on using the repository browser.