keys.h
1 /*
2 ** ClanLib SDK
3 ** Copyright (c) 1997-2015 The ClanLib Team
4 **
5 ** This software is provided 'as-is', without any express or implied
6 ** warranty. In no event will the authors be held liable for any damages
7 ** arising from the use of this software.
8 **
9 ** Permission is granted to anyone to use this software for any purpose,
10 ** including commercial applications, and to alter it and redistribute it
11 ** freely, subject to the following restrictions:
12 **
13 ** 1. The origin of this software must not be misrepresented; you must not
14 ** claim that you wrote the original software. If you use this software
15 ** in a product, an acknowledgment in the product documentation would be
16 ** appreciated but is not required.
17 ** 2. Altered source versions must be plainly marked as such, and must not be
18 ** misrepresented as being the original software.
19 ** 3. This notice may not be removed or altered from any source distribution.
20 **
21 ** Note: Some of the libraries ClanLib may link to may have additional
22 ** requirements or restrictions.
23 **
24 ** File Author(s):
25 **
26 ** Magnus Norddahl
27 ** Chu Chin Kuan
28 */
29
30 #pragma once
31
32 #include "input_code.h"
33
34 namespace clan
35 {
36
38 enum class Key
39 {
40 none = 0x00,
41 backspace = 0x08,
42 tab = 0x09, // ASCII HT, Horizontal tab
43 linefeed = 0x0a, // ASCII LF
44 clear = 0x0b, // ASCII VT
45 scroll = 0x0c, // ASCII FF, Clear screen
46 key_return = 0x0d, // ASCII CR, Enter key
47 select = 0x0e,
48 execute = 0x1a,
49 escape = 0x1b,
50 pause = 0x1c,
51 print = 0x1d,
52
53 space = 0x20,
54
55 prior = 0x21,
56 next = 0x22,
57 home = 0x23,
58 end = 0x24,
59 left = 0x25,
60 up = 0x26,
61 right = 0x27,
62 down = 0x28,
63
64 kanji = 0x29,
65 convert = 0x2a,
66 nonconvert = 0x2b,
67 separator = 0x2c, // ASCII ','
68
69 help = 0x3f, // ASCII '?'
70
71 key_0 = '0', // 0x30
72 key_1 = '1',
73 key_2 = '2',
74 key_3 = '3',
75 key_4 = '4',
76 key_5 = '5',
77 key_6 = '6',
78 key_7 = '7',
79 key_8 = '8',
80 key_9 = '9',
81
82 a = 'A', // 0x41
83 b = 'B',
84 c = 'C',
85 d = 'D',
86 e = 'E',
87 f = 'F',
88 g = 'G',
89 h = 'H',
90 i = 'I',
91 j = 'J',
92 k = 'K',
93 l = 'L',
94 m = 'M',
95 n = 'N',
96 o = 'O',
97 p = 'P',
98 q = 'Q',
99 r = 'R',
100 s = 'S',
101 t = 'T',
102 u = 'U',
103 v = 'V',
104 w = 'W',
105 x = 'X',
106 y = 'Y',
107 z = 'Z',
108
109 f1 = 0x61, // ASCII 'a'
110 f2 = 0x62,
111 f3 = 0x63,
112 f4 = 0x64,
113 f5 = 0x65,
114 f6 = 0x66,
115 f7 = 0x67,
116 f8 = 0x68,
117 f9 = 0x69,
118 f10 = 0x6a,
119 f11 = 0x6b,
120 f12 = 0x6c,
121 f13 = 0x6d,
122 f14 = 0x6e,
123 f15 = 0x6f,
124 f16 = 0x70,
125 f17 = 0x71,
126 f18 = 0x72,
127 f19 = 0x73,
128 f20 = 0x74,
129 f21 = 0x75,
130 f22 = 0x76,
131 f23 = 0x77,
132 f24 = 0x78,
133
134 insert = 0x7e,
135 key_delete = 0x7f, // ASCII DEL
136
137 // Numpad numbers
138 numpad_0 = 0x80,
139 numpad_1 = 0x81,
140 numpad_2 = 0x82,
141 numpad_3 = 0x83,
142 numpad_4 = 0x84,
143 numpad_5 = 0x85,
144 numpad_6 = 0x86,
145 numpad_7 = 0x87,
146 numpad_8 = 0x88,
147 numpad_9 = 0x89,
148
149 // Numpad buttons
150 multiply = 0x8a,
151 add = 0x8b,
152 seperator = 0x8c,
153 subtract = 0x8d,
154 decimal = 0x8e,
155 divide = 0x8f,
156
157 // Modifiers
158 lshift = 0xe0,
159 rshift = 0xe1,
160 lcontrol = 0xe2,
161 rcontrol = 0xe3,
162 lalt = 0xe4, loption = lalt,
163 ralt = 0xe5, roption = ralt,
164 lmenu = 0xe6, apps = lmenu,
165 rmenu = 0xe7,
166 lsuper = 0xe8, lcmd = lsuper,
167 rsuper = 0xe9, rcmd = rsuper,
168
169 scrolllock = 0xea,
170 capslock = 0xeb,
171 numlock = 0xec
172 };
173
174 Key decode_ic(InputCode);
175
176 }
clan::Key::f7
clan::Key::rsuper
clan::Key::n
clan::Key::f21
clan::Key::k
clan
Definition: clanapp.h:35
clan::Key::next
clan::Key::key_return
clan::Key::u
clan::Key::help
clan::Key::rcontrol
clan::Key::add
clan::Key::f5
clan::Key::q
clan::Key::kanji
clan::Key::space
clan::Key::f1
clan::Key::key_6
clan::Key::f3
clan::Key::numpad_3
clan::Key::s
clan::Key::key_5
clan::Key::f15
clan::Key::select
clan::Key::home
clan::Key::multiply
clan::Key::backspace
clan::Key::loption
clan::Key::linefeed
clan::Key::x
clan::Key::g
clan::Key::scroll
clan::Key::ralt
clan::Key::key_2
clan::Key::numpad_4
clan::Key::rcmd
clan::Key::f10
clan::Key::f14
clan::Key::apps
clan::Key::t
clan::Key::numlock
clan::Key::up
clan::Key::l
clan::Key::numpad_9
clan::Key::d
clan::Key::numpad_5
clan::Key::f18
clan::Key::print
clan::Key::convert
clan::Key::f9
clan::Key::key_3
clan::Key::rshift
clan::Key::key_7
clan::Key::v
clan::Key::numpad_0
clan::Key::numpad_2
clan::Key::key_8
clan::Key::separator
clan::Key::r
clan::Key::key_delete
clan::Key::seperator
clan::Key::execute
clan::Key::lsuper
clan::Key
Key
Enumeration of keyboard keys recognized on ClanLib.
Definition: keys.h:38
clan::Key::key_4
clan::Key::m
clan::Key::f
clan::Key::f17
clan::Key::lalt
clan::Key::y
clan::Key::divide
clan::Key::lshift
clan::Key::key_0
clan::InputCode
InputCode
Definition: input_code.h:46
clan::Key::a
clan::Key::f2
clan::Key::p
clan::Key::o
clan::Key::insert
clan::Key::roption
clan::Key::capslock
clan::Key::h
clan::Key::subtract
clan::Key::f13
clan::Key::f19
clan::Key::pause
clan::decode_ic
Key decode_ic(InputCode)
clan::Key::i
clan::Key::e
clan::Key::left
clan::Key::f22
clan::Key::none
clan::Key::escape
clan::Key::tab
clan::Key::j
clan::Key::right
clan::Key::lmenu
clan::Key::nonconvert
clan::Key::numpad_7
clan::Key::numpad_1
clan::Key::f23
clan::Key::f6
clan::Key::key_9
clan::Key::b
clan::Key::prior
clan::Key::f16
clan::Key::f4
clan::Key::c
clan::Key::numpad_8
clan::Key::decimal
clan::Key::down
clan::Key::key_1
clan::Key::f20
clan::Key::f24
clan::Key::f12
clan::Key::rmenu
clan::Key::w
clan::Key::scrolllock
clan::Key::f8
clan::Key::lcontrol
clan::Key::f11
clan::Key::numpad_6
clan::Key::clear
clan::Key::z
clan::Key::end
clan::Key::lcmd