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

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

style: Remove trailing whitespace on _all_ lines, including empty ones, for particular file types.

Command used: tools/srepl '\s\+$' '' -- *.c *.h *.py *.sh *.s *.S *.ag

Currently, whitespace on empty lines is very inconsistent.
There are two basic choices: Either remove the whitespace, or keep empty lines
indented to the level of surrounding code. The former is AFAICT more common,
and also much easier to do automatically.

Alternatively, we could write script for automatic indentation, and use that
instead. However, if such a script exists, it's possible to use the indented
style locally, by having the editor apply relevant conversions on load/save,
without affecting remote repository. IMO, it makes more sense to adopt
the simpler rule.

  • Property mode set to 100644
File size: 3.8 KB
RevLine 
[fa09449]1/*
2 * Copyright (c) 2009 Jiri Svoboda
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * - Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * - Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * - The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29/** @addtogroup libc
[2595dab]30 * @{
[fa09449]31 */
32/** @file
33 */
34
[2595dab]35#ifndef LIBC_IO_KEYCODE_H_
36#define LIBC_IO_KEYCODE_H_
[fa09449]37
38/** Keycode definitions.
39 *
40 * A keycode identifies a key by its position on the keyboard, rather
41 * than by its label. For human readability, key positions are noted
42 * with the key label on a keyboard with US layout. This label has
43 * nothing to do with the character, that the key produces
44 * -- this is determined by the keymap.
45 *
46 * The keyboard model reflects a standard PC keyboard layout.
47 * Non-standard keyboards need to be mapped to this model in some
48 * logical way. Scancodes are mapped to keycodes with a scanmap.
49 *
50 * For easier mapping to the model and to emphasize the nature of keycodes,
51 * they really are organized here by position, rather than by label.
52 */
[369a5f8]53typedef enum {
[fa09449]54
55 /* Main block row 1 */
56
[f89979b]57 KC_BACKTICK = 1,
[fa09449]58
59 KC_1,
60 KC_2,
61 KC_3,
62 KC_4,
63 KC_5,
64 KC_6,
65 KC_7,
66 KC_8,
67 KC_9,
68 KC_0,
69
70 KC_MINUS,
71 KC_EQUALS,
72 KC_BACKSPACE,
73
74 /* Main block row 2 */
75
76 KC_TAB,
77
78 KC_Q,
79 KC_W,
80 KC_E,
81 KC_R,
82 KC_T,
83 KC_Y,
84 KC_U,
85 KC_I,
86 KC_O,
87 KC_P,
88
89 KC_LBRACKET,
90 KC_RBRACKET,
91
92 /* Main block row 3 */
93
94 KC_CAPS_LOCK,
[a35b458]95
[fa09449]96 KC_A,
97 KC_S,
98 KC_D,
99 KC_F,
100 KC_G,
101 KC_H,
102 KC_J,
103 KC_K,
104 KC_L,
105
106 KC_SEMICOLON,
107 KC_QUOTE,
108 KC_BACKSLASH,
[c072a29]109 KC_HASH,
[fa09449]110
111 KC_ENTER,
112
113 /* Main block row 4 */
114
115 KC_LSHIFT,
116
117 KC_Z,
118 KC_X,
119 KC_C,
120 KC_V,
121 KC_B,
122 KC_N,
123 KC_M,
124
125 KC_COMMA,
126 KC_PERIOD,
127 KC_SLASH,
128
129 KC_RSHIFT,
130
131 /* Main block row 5 */
132
133 KC_LCTRL,
134 KC_LALT,
135 KC_SPACE,
136 KC_RALT,
137 KC_RCTRL,
138
139 /* Function keys block */
140
141 KC_ESCAPE,
142
143 KC_F1,
144 KC_F2,
145 KC_F3,
146 KC_F4,
147 KC_F5,
148 KC_F6,
149 KC_F7,
150 KC_F8,
151 KC_F9,
152 KC_F10,
153 KC_F11,
154 KC_F12,
155
156 KC_PRTSCR,
[c072a29]157 KC_SYSREQ,
[fa09449]158 KC_SCROLL_LOCK,
159 KC_PAUSE,
[c072a29]160 KC_BREAK,
[fa09449]161
162 /* Cursor keys block */
163
164 KC_INSERT,
165 KC_HOME,
166 KC_PAGE_UP,
167
168 KC_DELETE,
169 KC_END,
170 KC_PAGE_DOWN,
171
172 KC_UP,
173 KC_LEFT,
174 KC_DOWN,
175 KC_RIGHT,
176
177 /* Numeric block */
178
179 KC_NUM_LOCK,
180 KC_NSLASH,
181 KC_NTIMES,
182 KC_NMINUS,
183
184 KC_NPLUS,
185 KC_NENTER,
186
187 KC_N7,
188 KC_N8,
189 KC_N9,
190
191 KC_N4,
192 KC_N5,
193 KC_N6,
194
195 KC_N1,
196 KC_N2,
197 KC_N3,
198
199 KC_N0,
200 KC_NPERIOD
[a35b458]201
[fa09449]202} keycode_t;
203
[369a5f8]204typedef enum {
[2595dab]205 KM_LSHIFT = 0x001,
206 KM_RSHIFT = 0x002,
207 KM_LCTRL = 0x004,
208 KM_RCTRL = 0x008,
209 KM_LALT = 0x010,
210 KM_RALT = 0x020,
211 KM_CAPS_LOCK = 0x040,
212 KM_NUM_LOCK = 0x080,
213 KM_SCROLL_LOCK = 0x100,
[a35b458]214
[2595dab]215 KM_SHIFT = KM_LSHIFT | KM_RSHIFT,
216 KM_CTRL = KM_LCTRL | KM_RCTRL,
217 KM_ALT = KM_LALT | KM_RALT
[fa09449]218} keymod_t;
219
220#endif
[2595dab]221
[fa09449]222/** @}
223 */
Note: See TracBrowser for help on using the repository browser.