keys.h
1 /*
2  ** ClanLib SDK
3  ** Copyright (c) 1997-2016 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 {
37  enum class Key
38  {
39  none = 0x00,
40  backspace = 0x08,
41  tab = 0x09, // ASCII HT, Horizontal tab
42  linefeed = 0x0a, // ASCII LF
43  clear = 0x0b, // ASCII VT
44  scroll = 0x0c, // ASCII FF, Clear screen
45  key_return = 0x0d, // ASCII CR, Enter key
46  select = 0x0e,
47  execute = 0x1a,
48  escape = 0x1b,
49  pause = 0x1c,
50  print = 0x1d,
51 
52  space = 0x20,
53 
54  prior = 0x21,
55  next = 0x22,
56  home = 0x23,
57  end = 0x24,
58  left = 0x25,
59  up = 0x26,
60  right = 0x27,
61  down = 0x28,
62 
63  kanji = 0x29,
64  convert = 0x2a,
65  nonconvert = 0x2b,
66  separator = 0x2c, // ASCII ','
67 
68  help = 0x3f, // ASCII '?'
69 
70  key_0 = '0', // 0x30
71  key_1 = '1',
72  key_2 = '2',
73  key_3 = '3',
74  key_4 = '4',
75  key_5 = '5',
76  key_6 = '6',
77  key_7 = '7',
78  key_8 = '8',
79  key_9 = '9',
80 
81  a = 'A', // 0x41
82  b = 'B',
83  c = 'C',
84  d = 'D',
85  e = 'E',
86  f = 'F',
87  g = 'G',
88  h = 'H',
89  i = 'I',
90  j = 'J',
91  k = 'K',
92  l = 'L',
93  m = 'M',
94  n = 'N',
95  o = 'O',
96  p = 'P',
97  q = 'Q',
98  r = 'R',
99  s = 'S',
100  t = 'T',
101  u = 'U',
102  v = 'V',
103  w = 'W',
104  x = 'X',
105  y = 'Y',
106  z = 'Z',
107 
108  f1 = 0x61, // ASCII 'a'
109  f2 = 0x62,
110  f3 = 0x63,
111  f4 = 0x64,
112  f5 = 0x65,
113  f6 = 0x66,
114  f7 = 0x67,
115  f8 = 0x68,
116  f9 = 0x69,
117  f10 = 0x6a,
118  f11 = 0x6b,
119  f12 = 0x6c,
120  f13 = 0x6d,
121  f14 = 0x6e,
122  f15 = 0x6f,
123  f16 = 0x70,
124  f17 = 0x71,
125  f18 = 0x72,
126  f19 = 0x73,
127  f20 = 0x74,
128  f21 = 0x75,
129  f22 = 0x76,
130  f23 = 0x77,
131  f24 = 0x78,
132 
133  insert = 0x7e,
134  key_delete = 0x7f, // ASCII DEL
135 
136  // Numpad numbers
137  numpad_0 = 0x80,
138  numpad_1 = 0x81,
139  numpad_2 = 0x82,
140  numpad_3 = 0x83,
141  numpad_4 = 0x84,
142  numpad_5 = 0x85,
143  numpad_6 = 0x86,
144  numpad_7 = 0x87,
145  numpad_8 = 0x88,
146  numpad_9 = 0x89,
147 
148  // Numpad buttons
149  multiply = 0x8a,
150  add = 0x8b,
151  seperator = 0x8c,
152  subtract = 0x8d,
153  decimal = 0x8e,
154  divide = 0x8f,
155 
156  // Modifiers
157  lshift = 0xe0,
158  rshift = 0xe1,
159  lcontrol = 0xe2,
160  rcontrol = 0xe3,
161  lalt = 0xe4, loption = lalt,
162  ralt = 0xe5, roption = ralt,
163  lmenu = 0xe6, apps = lmenu,
164  rmenu = 0xe7,
165  lsuper = 0xe8, lcmd = lsuper,
166  rsuper = 0xe9, rcmd = rsuper,
167 
168  scrolllock = 0xea,
169  capslock = 0xeb,
170  numlock = 0xec
171  };
172 
174 }
Definition: clanapp.h:35
Key
Enumeration of keyboard keys recognized on ClanLib.
Definition: keys.h:37
InputCode
Definition: input_code.h:46
Key decode_ic(InputCode)