keys.h Source File - ClanLib SDK
Description: keys.h Source File

keys.h
1/*
2 ** ClanLib SDK
3 ** Copyright (c) 1997-2020 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
34namespace 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
173 Key decode_ic(InputCode);
174}
clan::Handedness::right
@ right
clan::Handedness::left
@ left
clan::DrawBuffer::none
@ none
clan::BlendEquation::add
@ add
clan::BlendEquation::subtract
@ subtract
clan::InputCode
InputCode
Definition input_code.h:47
clan
Definition clanapp.h:36
clan::decode_ic
Key decode_ic(InputCode)
clan::Key
Key
Enumeration of keyboard keys recognized on ClanLib.
Definition keys.h:38
clan::Key::clear
@ clear
clan::Key::lalt
@ lalt
clan::Key::s
@ s
clan::Key::scroll
@ scroll
clan::Key::lcontrol
@ lcontrol
clan::Key::a
@ a
clan::Key::multiply
@ multiply
clan::Key::home
@ home
clan::Key::numpad_2
@ numpad_2
clan::Key::f14
@ f14
clan::Key::f3
@ f3
clan::Key::f22
@ f22
clan::Key::scrolllock
@ scrolllock
clan::Key::rcontrol
@ rcontrol
clan::Key::numpad_4
@ numpad_4
clan::Key::nonconvert
@ nonconvert
clan::Key::key_5
@ key_5
clan::Key::key_2
@ key_2
clan::Key::h
@ h
clan::Key::key_3
@ key_3
clan::Key::l
@ l
clan::Key::convert
@ convert
clan::Key::j
@ j
clan::Key::f2
@ f2
clan::Key::lshift
@ lshift
clan::Key::key_8
@ key_8
clan::Key::loption
@ loption
clan::Key::f20
@ f20
clan::Key::y
@ y
clan::Key::key_7
@ key_7
clan::Key::up
@ up
clan::Key::numpad_7
@ numpad_7
clan::Key::c
@ c
clan::Key::r
@ r
clan::Key::capslock
@ capslock
clan::Key::backspace
@ backspace
clan::Key::f8
@ f8
clan::Key::lcmd
@ lcmd
clan::Key::f19
@ f19
clan::Key::key_return
@ key_return
clan::Key::f6
@ f6
clan::Key::f9
@ f9
clan::Key::numpad_0
@ numpad_0
clan::Key::help
@ help
clan::Key::linefeed
@ linefeed
clan::Key::f7
@ f7
clan::Key::numpad_6
@ numpad_6
clan::Key::f4
@ f4
clan::Key::m
@ m
clan::Key::numpad_5
@ numpad_5
clan::Key::f5
@ f5
clan::Key::down
@ down
clan::Key::q
@ q
clan::Key::lmenu
@ lmenu
clan::Key::kanji
@ kanji
clan::Key::u
@ u
clan::Key::n
@ n
clan::Key::end
@ end
clan::Key::f12
@ f12
clan::Key::key_9
@ key_9
clan::Key::d
@ d
clan::Key::f10
@ f10
clan::Key::p
@ p
clan::Key::rcmd
@ rcmd
clan::Key::i
@ i
clan::Key::f13
@ f13
clan::Key::rshift
@ rshift
clan::Key::k
@ k
clan::Key::f23
@ f23
clan::Key::f
@ f
clan::Key::b
@ b
clan::Key::divide
@ divide
clan::Key::select
@ select
clan::Key::key_0
@ key_0
clan::Key::apps
@ apps
clan::Key::rsuper
@ rsuper
clan::Key::x
@ x
clan::Key::v
@ v
clan::Key::roption
@ roption
clan::Key::separator
@ separator
clan::Key::f16
@ f16
clan::Key::key_6
@ key_6
clan::Key::key_delete
@ key_delete
clan::Key::numpad_9
@ numpad_9
clan::Key::g
@ g
clan::Key::ralt
@ ralt
clan::Key::numpad_3
@ numpad_3
clan::Key::key_1
@ key_1
clan::Key::f1
@ f1
clan::Key::decimal
@ decimal
clan::Key::numpad_8
@ numpad_8
clan::Key::rmenu
@ rmenu
clan::Key::numlock
@ numlock
clan::Key::next
@ next
clan::Key::key_4
@ key_4
clan::Key::f15
@ f15
clan::Key::f18
@ f18
clan::Key::o
@ o
clan::Key::prior
@ prior
clan::Key::insert
@ insert
clan::Key::escape
@ escape
clan::Key::e
@ e
clan::Key::t
@ t
clan::Key::seperator
@ seperator
clan::Key::tab
@ tab
clan::Key::execute
@ execute
clan::Key::pause
@ pause
clan::Key::w
@ w
clan::Key::numpad_1
@ numpad_1
clan::Key::f11
@ f11
clan::Key::print
@ print
clan::Key::z
@ z
clan::Key::f21
@ f21
clan::Key::f17
@ f17
clan::Key::lsuper
@ lsuper
clan::Key::space
@ space
clan::Key::f24
@ f24