cpp-terminal 1.0.0
Small C++ library for writing multiplatform terminal applications
Loading...
Searching...
No Matches
key.hpp
Go to the documentation of this file.
1/*
2* cpp-terminal
3* C++ library for writing multi-platform terminal applications.
4*
5* SPDX-FileCopyrightText: 2019-2024 cpp-terminal
6*
7* SPDX-License-Identifier: MIT
8*/
9
10#pragma once
11
12#include <cstdint>
13#include <string>
14
15namespace Term
16{
17
19{
20public:
21 enum class Value : std::int32_t
22 {
23 // Last utf8 codepoint is U+10FFFF (000100001111111111111111) So:
24 None = 0,
25 Alt = (1UL << 22UL),
26 Ctrl = (1UL << 23UL),
27 };
28
29 constexpr MetaKey() : value(static_cast<std::int32_t>(Value::None)) {}
30 constexpr MetaKey(const MetaKey& key) = default;
31 inline MetaKey& operator=(const MetaKey& key) = default;
32
33 constexpr MetaKey(const Value& v) : value(static_cast<std::int32_t>(v)) {}
34 inline MetaKey& operator=(const Value& v)
35 {
36 this->value = static_cast<std::int32_t>(v);
37 return *this;
38 }
39
40 explicit constexpr MetaKey(std::int32_t val) : value(val) {}
41 inline MetaKey& operator=(std::int32_t val)
42 {
43 this->value = val;
44 return *this;
45 }
46
47 explicit constexpr operator std::int32_t() const { return this->value; }
48
49 constexpr bool hasAlt() const { return (this->value & static_cast<std::int32_t>(MetaKey::Value::Alt)) == static_cast<std::int32_t>(MetaKey::Value::Alt); }
50 constexpr bool hasCtrl() const { return (this->value & static_cast<std::int32_t>(MetaKey::Value::Ctrl)) == static_cast<std::int32_t>(MetaKey::Value::Ctrl); }
51
52 friend constexpr MetaKey operator+(MetaKey l, MetaKey r) { return MetaKey(l.value | r.value); }
53 friend constexpr MetaKey operator+(MetaKey::Value l, MetaKey::Value r) { return MetaKey(l) + MetaKey(r); }
54 friend constexpr MetaKey operator+(MetaKey l, MetaKey::Value r) { return l + MetaKey(r); }
55 friend constexpr MetaKey operator+(MetaKey::Value l, MetaKey r) { return MetaKey(l) + r; }
56
57 MetaKey& operator+=(MetaKey r) { return *this = *this + r; }
58 MetaKey& operator+=(MetaKey::Value r) { return *this = *this + r; }
59
60 friend constexpr bool operator==(MetaKey l, MetaKey r) { return l.value == r.value; }
61 friend constexpr bool operator==(MetaKey l, MetaKey::Value r) { return l == MetaKey(r); }
62 friend constexpr bool operator==(MetaKey::Value l, MetaKey r) { return MetaKey(l) == r; }
63
64 friend constexpr bool operator!=(MetaKey l, MetaKey r) { return !(l == r); }
65 friend constexpr bool operator!=(MetaKey l, MetaKey::Value r) { return !(l == r); }
66 friend constexpr bool operator!=(MetaKey::Value l, MetaKey r) { return !(l == r); }
67
68 friend constexpr bool operator<(MetaKey l, MetaKey r) { return l.value < r.value; }
69
70 friend constexpr bool operator>=(MetaKey l, MetaKey r) { return !(l < r); }
71 friend constexpr bool operator>=(MetaKey l, MetaKey::Value r) { return !(l < r); }
72 friend constexpr bool operator>=(MetaKey::Value l, MetaKey r) { return !(l < r); }
73
74 friend constexpr bool operator>(MetaKey l, MetaKey r) { return r < l; }
75 friend constexpr bool operator>(MetaKey l, MetaKey::Value r) { return r < l; }
76 friend constexpr bool operator>(MetaKey::Value l, MetaKey r) { return r < l; }
77
78 friend constexpr bool operator<=(MetaKey l, MetaKey r) { return !(l > r); }
79 friend constexpr bool operator<=(MetaKey l, MetaKey::Value r) { return !(l > r); }
80 friend constexpr bool operator<=(MetaKey::Value l, MetaKey r) { return !(l > r); }
81
82 std::int32_t value;
83};
84
85class Key
86{
87public:
88 using value_type = std::int32_t;
89
90 enum Value : std::int32_t
91 {
92 NoKey = -1,
93 // Now use << to for detecting special key + key press
94
95 // Begin ASCII (some ASCII names has been change to their Ctrl_+key part) the value is different to be able to do
97 Ctrl_A = 1,
98 Ctrl_B = 2,
99 Ctrl_C = 3,
104 Ctrl_H = 8, /*corresponds to Backspace*/
105 Ctrl_I = 9, /*corresponds to Tab*/
106 Ctrl_J = 10,
107 Ctrl_K = 11,
108 Ctrl_L = 12,
109 Ctrl_M = 13, /*corresponds to Enter*/
110 Ctrl_N = 14,
111 Ctrl_O = 15,
112 Ctrl_P = 16,
113 Ctrl_Q = 17,
114 Ctrl_R = 18,
115 Ctrl_S = 19,
116 Ctrl_T = 20,
117 Ctrl_U = 21,
118 Ctrl_V = 22,
119 Ctrl_W = 23,
120 Ctrl_X = 24,
121 Ctrl_Y = 25,
122 Ctrl_Z = 26,
123 Ctrl_OpenBracket = 27, /*corresponds to Escape*/
128 Space = 32,
130 Quote = 34,
131 Hash = 35,
132 Dollar = 36,
139 Plus = 43,
140 Comma = 44,
141 Hyphen = 45,
142 Minus = 45,
143 Period = 46,
144 Slash = 47,
145 Zero = 48,
146 One = 49,
147 Two = 50,
148 Three = 51,
149 Four = 52,
150 Five = 53,
151 Six = 54,
152 Seven = 55,
153 Eight = 56,
154 Nine = 57,
155 Colon = 58,
159 Equal = 61,
164 A = 65,
165 B = 66,
166 C = 67,
167 D = 68,
168 E = 69,
169 F = 70,
170 G = 71,
171 H = 72,
172 I = 73,
173 J = 74,
174 K = 75,
175 L = 76,
176 M = 77,
177 N = 78,
178 O = 79,
179 P = 80,
180 Q = 81,
181 R = 82,
182 S = 83,
183 T = 84,
184 U = 85,
185 V = 86,
186 W = 87,
187 X = 88,
188 Y = 89,
189 Z = 90,
193 Caret = 94,
196 a = 97,
197 b = 98,
198 c = 99,
199 d = 100,
200 e = 101,
201 f = 102,
202 g = 103,
203 h = 104,
204 i = 105,
205 j = 106,
206 k = 107,
207 l = 108,
208 m = 109,
209 n = 110,
210 o = 111,
211 p = 112,
212 q = 113,
213 r = 114,
214 s = 115,
215 t = 116,
216 u = 117,
217 v = 118,
218 w = 119,
219 x = 120,
220 y = 121,
221 z = 122,
225 Tilde = 126,
226 CTRL_QuestionMark = 127, /*corresponds to DEL*/
227 // Very useful CTRL_* alternative names
228 Null = 0,
230 Tab = 9,
231 Enter = 13,
232 Esc = 27,
233 Del = 127,
234 //
235 // End ASCII
236 // Extended ASCII goes up to 255
237 // Last Unicode codepage 0x10FFFF
238 ArrowLeft = 0x10FFFF + 1,
239 ArrowRight = 0x10FFFF + 2,
240 ArrowUp = 0x10FFFF + 3,
241 ArrowDown = 0x10FFFF + 4,
242 Numeric5 = 0x10FFFF + 5,
243 Home = 0x10FFFF + 6,
244 Insert = 0x10FFFF + 7,
245 End = 0x10FFFF + 8,
246 PageUp = 0x10FFFF + 9,
247 PageDown = 0x10FFFF + 10,
248 F1 = 0x10FFFF + 11,
249 F2 = 0x10FFFF + 12,
250 F3 = 0x10FFFF + 13,
251 F4 = 0x10FFFF + 14,
252 F5 = 0x10FFFF + 15,
253 F6 = 0x10FFFF + 16,
254 F7 = 0x10FFFF + 17,
255 F8 = 0x10FFFF + 18,
256 F9 = 0x10FFFF + 19,
257 F10 = 0x10FFFF + 20,
258 F11 = 0x10FFFF + 21,
259 F12 = 0x10FFFF + 22,
260 F13 = 0x10FFFF + 23,
261 F14 = 0x10FFFF + 24,
262 F15 = 0x10FFFF + 25,
263 F16 = 0x10FFFF + 26,
264 F17 = 0x10FFFF + 27,
265 F18 = 0x10FFFF + 28,
266 F19 = 0x10FFFF + 29,
267 F20 = 0x10FFFF + 30,
268 F21 = 0x10FFFF + 31,
269 F22 = 0x10FFFF + 32,
270 F23 = 0x10FFFF + 33,
271 F24 = 0x10FFFF + 34,
272 PrintScreen = 0x10FFFF + 35,
273 Menu = 0x10FFFF + 36,
274 };
275
276 constexpr Key() : value(NoKey) {}
277 constexpr Key(const Key& key) = default;
278 inline Key& operator=(const Key& key) = default;
279
280 constexpr Key(const Value& v) : value(static_cast<std::int32_t>(v)) {}
281 inline Key& operator=(const Value& v)
282 {
283 this->value = static_cast<std::int32_t>(v);
284 return *this;
285 }
286
287 explicit constexpr Key(char val) : value(static_cast<std::int32_t>(val)) {}
288 inline Key& operator=(char val)
289 {
290 value = static_cast<std::int32_t>(val);
291 return *this;
292 }
293
294 constexpr Key(std::int32_t val) : value(val) {}
295 inline Key& operator=(std::int32_t val)
296 {
297 value = val;
298 return *this;
299 }
300
301 explicit constexpr Key(std::size_t val) : value(static_cast<std::int32_t>(val)) {}
302 inline Key& operator=(std::size_t val)
303 {
304 value = static_cast<std::int32_t>(val);
305 return *this;
306 }
307
308 explicit constexpr Key(char32_t val) : value(static_cast<std::int32_t>(val)) {}
309 inline Key& operator=(char32_t val)
310 {
311 value = static_cast<std::int32_t>(val);
312 return *this;
313 }
314
315 constexpr operator std::int32_t() const { return this->value; }
316
317 friend constexpr bool operator==(Key l, Key r) { return l.value == r.value; }
318 friend constexpr bool operator==(Key l, char r) { return l == Key(r); }
319 friend constexpr bool operator==(char l, Key r) { return Key(l) == r; }
320 friend constexpr bool operator==(Key l, char32_t r) { return l == Key(r); }
321 friend constexpr bool operator==(char32_t l, Key r) { return Key(l) == r; }
322 friend constexpr bool operator==(Key l, std::int32_t r) { return l == Key(r); }
323 friend constexpr bool operator==(std::int32_t l, Key r) { return Key(l) == r; }
324 friend constexpr bool operator==(Key l, std::size_t r) { return static_cast<std::size_t>(l.value) == r; }
325 friend constexpr bool operator==(std::size_t l, Key r) { return l == static_cast<std::size_t>(r.value); }
326
327 friend constexpr bool operator!=(Key l, Key r) { return !(l == r); }
328 friend constexpr bool operator!=(Key l, char r) { return !(l == r); }
329 friend constexpr bool operator!=(char l, Key r) { return !(l == r); }
330 friend constexpr bool operator!=(Key l, char32_t r) { return !(l == r); }
331 friend constexpr bool operator!=(char32_t l, Key r) { return !(l == r); }
332 friend constexpr bool operator!=(Key l, std::int32_t r) { return !(l == r); }
333 friend constexpr bool operator!=(std::int32_t l, Key r) { return !(l == r); }
334 friend constexpr bool operator!=(Key l, std::size_t r) { return !(l == r); }
335 friend constexpr bool operator!=(std::size_t l, Key r) { return !(l == r); }
336
337 friend constexpr bool operator<(Key l, Key r) { return l.value < r.value; }
338 friend constexpr bool operator<(Key l, char r) { return l < Key(r); }
339 friend constexpr bool operator<(char l, Key r) { return Key(l) < r; }
340 friend constexpr bool operator<(Key l, char32_t r) { return l < Key(r); }
341 friend constexpr bool operator<(char32_t l, Key r) { return Key(l) < r; }
342 friend constexpr bool operator<(Key l, std::int32_t r) { return l < Key(r); }
343 friend constexpr bool operator<(std::int32_t l, Key r) { return Key(l) < r; }
344 friend constexpr bool operator<(Key l, std::size_t r) { return static_cast<std::size_t>(l.value) < r; }
345 friend constexpr bool operator<(std::size_t l, Key r) { return l < static_cast<std::size_t>(r.value); }
346
347 friend constexpr bool operator>=(Key l, Key r) { return !(l < r); }
348 friend constexpr bool operator>=(Key l, char r) { return !(l < r); }
349 friend constexpr bool operator>=(char l, Key r) { return !(l < r); }
350 friend constexpr bool operator>=(Key l, char32_t r) { return !(l < r); }
351 friend constexpr bool operator>=(char32_t l, Key r) { return !(l < r); }
352 friend constexpr bool operator>=(Key l, std::int32_t r) { return !(l < r); }
353 friend constexpr bool operator>=(std::int32_t l, Key r) { return !(l < r); }
354 friend constexpr bool operator>=(Key l, std::size_t r) { return !(l < r); }
355 friend constexpr bool operator>=(std::size_t l, Key r) { return !(l < r); }
356
357 friend constexpr bool operator>(Key l, Key r) { return r < l; }
358 friend constexpr bool operator>(Key l, char r) { return r < l; }
359 friend constexpr bool operator>(char l, Key r) { return r < l; }
360 friend constexpr bool operator>(Key l, char32_t r) { return r < l; }
361 friend constexpr bool operator>(char32_t l, Key r) { return r < l; }
362 friend constexpr bool operator>(Key l, std::int32_t r) { return r < l; }
363 friend constexpr bool operator>(std::int32_t l, Key r) { return r < l; }
364 friend constexpr bool operator>(Key l, std::size_t r) { return r < l; }
365 friend constexpr bool operator>(std::size_t l, Key r) { return r < l; }
366
367 friend constexpr bool operator<=(Key l, Key r) { return !(l > r); }
368 friend constexpr bool operator<=(Key l, char r) { return !(l > r); }
369 friend constexpr bool operator<=(char l, Key r) { return !(l > r); }
370 friend constexpr bool operator<=(Key l, char32_t r) { return !(l > r); }
371 friend constexpr bool operator<=(char32_t l, Key r) { return !(l > r); }
372 friend constexpr bool operator<=(Key l, std::int32_t r) { return !(l > r); }
373 friend constexpr bool operator<=(std::int32_t l, Key r) { return !(l > r); }
374 friend constexpr bool operator<=(Key l, std::size_t r) { return !(l > r); }
375 friend constexpr bool operator<=(std::size_t l, Key r) { return !(l > r); }
376
377 constexpr bool iscntrl() const { return (*this >= Key::Null && *this <= Key::Ctrl_Underscore) || *this == Key::Del; }
378 constexpr bool isblank() const { return *this == Key::Tab || *this == Key::Space; }
379 constexpr bool isspace() const { return this->isblank() || (*this >= Key::Ctrl_J && *this <= Key::Enter); }
380 constexpr bool isupper() const { return *this >= Key::A && *this <= Key::Z; }
381 constexpr bool islower() const { return *this >= Key::a && *this <= Key::z; }
382 constexpr bool isalpha() const { return (this->isupper() || this->islower()); }
383 constexpr bool isdigit() const { return *this >= Key::Zero && *this <= Key::Nine; }
384 constexpr bool isxdigit() const { return this->isdigit() || (*this >= Key::A && *this <= Key::F) || (*this >= Key::a && *this <= Key::f); }
385 constexpr bool isalnum() const { return (this->isdigit() || this->isalpha()); }
386 constexpr bool ispunct() const { return (*this >= Key::ExclamationMark && *this <= Key::Slash) || (*this >= Key::Colon && *this <= Key::Arobase) || (*this >= Key::OpenBracket && *this <= Key::GraveAccent) || (*this >= Key::OpenBrace && *this <= Key::Tilde); }
387 constexpr bool isgraph() const { return (this->isalnum() || this->ispunct()); }
388 constexpr bool isprint() const { return (this->isgraph() || *this == Key::Space); }
389 constexpr bool isunicode() const { return *this >= Key::Null && this->value <= 0x10FFFFL; }
390 constexpr Key tolower() const { return (this->isalpha() && this->isupper()) ? Key(this->value + 32) : *this; }
391 constexpr Key toupper() const { return (this->isalpha() && this->islower()) ? Key(this->value - 32) : *this; }
392
393 // Detect if *this is convertible to ANSII
394 constexpr bool isASCII() const { return *this >= Key::Null && *this <= Key::Del; }
395
396 // Detect if *this is convertible to Extended ANSII
397 constexpr bool isExtendedASCII() const { return *this >= Key::Null && this->value <= 255L; }
398
399 // Detect if *this has CTRL+*
400 constexpr bool hasCtrlAll() const { return this->iscntrl() || ((this->value & static_cast<std::int32_t>(MetaKey::Value::Ctrl)) == static_cast<std::int32_t>(MetaKey::Value::Ctrl)); }
401
402 // Detect if *this has CTRL+* (excluding the CTRL+* that can be access with standard *this Tab Backspace Enter...)
403 constexpr bool hasCtrl() const
404 {
405 // Need to suppress the TAB etc...
406 return ((this->iscntrl() || this->hasCtrlAll()) && *this != Key::Backspace && *this != Key::Tab && *this != Key::Esc && *this != Key::Enter && *this != Key::Del);
407 }
408
409 // Detect if key has ALT+*
410 constexpr bool hasAlt() const { return (this->value & static_cast<std::int32_t>(MetaKey::Value::Alt)) == static_cast<std::int32_t>(MetaKey::Value::Alt); }
411
412 constexpr bool empty() const { return (this->value == Key::NoKey); }
413
414 void append_name(std::string& strOut) const;
415 std::string name() const;
416 std::string str() const;
417
418 // member variable value
419 // cannot be Key::Value and has to be std::int32_t because it can also have numbers
420 // that are not named within the enum. Otherwise it would be undefined behaviour
421 std::int32_t value;
422};
423
424constexpr bool operator==(Key l, MetaKey r) { return static_cast<std::int32_t>(l) == static_cast<std::int32_t>(r); }
425constexpr bool operator==(MetaKey l, Key r) { return static_cast<std::int32_t>(l) == static_cast<std::int32_t>(r); }
426
427constexpr bool operator<(MetaKey l, Key r) { return static_cast<std::int32_t>(l) < static_cast<std::int32_t>(r); }
428constexpr bool operator<(Key l, MetaKey r) { return static_cast<std::int32_t>(l) < static_cast<std::int32_t>(r); }
429
430constexpr bool operator!=(Key l, MetaKey r) { return static_cast<std::int32_t>(l) != static_cast<std::int32_t>(r); }
431constexpr bool operator!=(MetaKey l, Key r) { return static_cast<std::int32_t>(l) != static_cast<std::int32_t>(r); }
432
433constexpr bool operator>=(MetaKey l, Key r) { return static_cast<std::int32_t>(l) >= static_cast<std::int32_t>(r); }
434constexpr bool operator>=(Key l, MetaKey r) { return static_cast<std::int32_t>(l) >= static_cast<std::int32_t>(r); }
435
436constexpr bool operator>(MetaKey l, Key r) { return static_cast<std::int32_t>(l) > static_cast<std::int32_t>(r); }
437constexpr bool operator>(Key l, MetaKey r) { return static_cast<std::int32_t>(l) > static_cast<std::int32_t>(r); }
438
439constexpr bool operator<=(MetaKey l, Key r) { return static_cast<std::int32_t>(l) <= static_cast<std::int32_t>(r); }
440constexpr bool operator<=(Key l, MetaKey r) { return static_cast<std::int32_t>(l) <= static_cast<std::int32_t>(r); }
441
442constexpr Key operator+(MetaKey metakey, Key key) { return Key(key.value + ((metakey == MetaKey::Value::Ctrl && !key.hasCtrlAll() && !key.empty()) ? static_cast<std::int32_t>(MetaKey::Value::Ctrl) : 0) + ((metakey == MetaKey::Value::Alt && !key.hasAlt() && !key.empty()) ? static_cast<std::int32_t>(MetaKey::Value::Alt) : 0)); }
443constexpr Key operator+(Key key, MetaKey meta) { return meta + key; }
444
445constexpr Key operator+(MetaKey::Value l, Key r) { return MetaKey(l) + r; }
446constexpr Key operator+(Key l, MetaKey::Value r) { return l + MetaKey(r); }
447constexpr Key operator+(MetaKey::Value l, Key::value_type r) { return MetaKey(l) + Key(r); }
448constexpr Key operator+(Key::value_type l, MetaKey::Value r) { return Key(l) + MetaKey(r); }
449
450} // namespace Term
friend constexpr bool operator==(Key l, char r)
Definition key.hpp:318
friend constexpr bool operator>=(char l, Key r)
Definition key.hpp:349
friend constexpr bool operator==(std::int32_t l, Key r)
Definition key.hpp:323
friend constexpr bool operator<=(char l, Key r)
Definition key.hpp:369
constexpr bool isExtendedASCII() const
Definition key.hpp:397
friend constexpr bool operator!=(Key l, std::int32_t r)
Definition key.hpp:332
@ ArrowRight
Definition key.hpp:239
@ Ctrl_R
Definition key.hpp:114
@ Ctrl_B
Definition key.hpp:98
@ Caret
Definition key.hpp:193
@ Minus
Definition key.hpp:142
@ Tilde
Definition key.hpp:225
@ Percent
Definition key.hpp:133
@ Ctrl_X
Definition key.hpp:120
@ Ctrl_A
Definition key.hpp:97
@ Ctrl_Y
Definition key.hpp:121
@ Eight
Definition key.hpp:153
@ Ctrl_J
Definition key.hpp:106
@ Hyphen
Definition key.hpp:141
@ CTRL_QuestionMark
Definition key.hpp:226
@ Ctrl_N
Definition key.hpp:110
@ OpenChevron
Definition key.hpp:158
@ CloseBracket
Definition key.hpp:192
@ QuestionMark
Definition key.hpp:162
@ Ctrl_O
Definition key.hpp:111
@ Ampersand
Definition key.hpp:134
@ ExclamationMark
Definition key.hpp:129
@ Ctrl_BackSlash
Definition key.hpp:124
@ Three
Definition key.hpp:148
@ ArrowLeft
Definition key.hpp:238
@ PageDown
Definition key.hpp:247
@ Ctrl_S
Definition key.hpp:115
@ PageUp
Definition key.hpp:246
@ Apostrophe
Definition key.hpp:135
@ Ctrl_Underscore
Definition key.hpp:127
@ Backslash
Definition key.hpp:191
@ OpenBrace
Definition key.hpp:222
@ Dollar
Definition key.hpp:132
@ Ctrl_K
Definition key.hpp:107
@ Ctrl_Z
Definition key.hpp:122
@ Ctrl_P
Definition key.hpp:112
@ Ctrl_G
Definition key.hpp:103
@ Arobase
Definition key.hpp:163
@ Ctrl_F
Definition key.hpp:102
@ Ctrl_M
Definition key.hpp:109
@ GreaterThan
Definition key.hpp:160
@ Quote
Definition key.hpp:130
@ PrintScreen
Definition key.hpp:272
@ Ctrl_D
Definition key.hpp:100
@ Ctrl_E
Definition key.hpp:101
@ Seven
Definition key.hpp:152
@ Ctrl_Caret
Definition key.hpp:126
@ Enter
Definition key.hpp:231
@ Underscore
Definition key.hpp:194
@ Ctrl_I
Definition key.hpp:105
@ OpenBracket
Definition key.hpp:190
@ Period
Definition key.hpp:143
@ Equal
Definition key.hpp:159
@ Ctrl_Arobase
Definition key.hpp:96
@ ArrowUp
Definition key.hpp:240
@ CloseParenthesis
Definition key.hpp:137
@ Semicolon
Definition key.hpp:156
@ Ctrl_OpenBracket
Definition key.hpp:123
@ Comma
Definition key.hpp:140
@ OpenParenthesis
Definition key.hpp:136
@ Colon
Definition key.hpp:155
@ GraveAccent
Definition key.hpp:195
@ LessThan
Definition key.hpp:157
@ Ctrl_L
Definition key.hpp:108
@ Backspace
Definition key.hpp:229
@ Ctrl_CloseBracket
Definition key.hpp:125
@ Ctrl_U
Definition key.hpp:117
@ Ctrl_H
Definition key.hpp:104
@ NoKey
Definition key.hpp:92
@ Ctrl_V
Definition key.hpp:118
@ CloseChevron
Definition key.hpp:161
@ Slash
Definition key.hpp:144
@ Close_Brace
Definition key.hpp:224
@ Ctrl_C
Definition key.hpp:99
@ Ctrl_T
Definition key.hpp:116
@ ArrowDown
Definition key.hpp:241
@ Ctrl_Q
Definition key.hpp:113
@ Numeric5
Definition key.hpp:242
@ VerticalBar
Definition key.hpp:223
@ Space
Definition key.hpp:128
@ Asterisk
Definition key.hpp:138
@ Ctrl_W
Definition key.hpp:119
@ Insert
Definition key.hpp:244
friend constexpr bool operator<(Key l, std::int32_t r)
Definition key.hpp:342
friend constexpr bool operator<(char l, Key r)
Definition key.hpp:339
friend constexpr bool operator<(std::int32_t l, Key r)
Definition key.hpp:343
friend constexpr bool operator<=(std::int32_t l, Key r)
Definition key.hpp:373
friend constexpr bool operator>=(Key l, Key r)
Definition key.hpp:347
constexpr bool empty() const
Definition key.hpp:412
friend constexpr bool operator==(char32_t l, Key r)
Definition key.hpp:321
friend constexpr bool operator!=(Key l, char r)
Definition key.hpp:328
Key & operator=(std::size_t val)
Definition key.hpp:302
std::int32_t value_type
Definition key.hpp:88
friend constexpr bool operator==(Key l, std::size_t r)
Definition key.hpp:324
friend constexpr bool operator<=(char32_t l, Key r)
Definition key.hpp:371
constexpr Key(std::int32_t val)
Definition key.hpp:294
constexpr bool isspace() const
Definition key.hpp:379
constexpr Key(std::size_t val)
Definition key.hpp:301
friend constexpr bool operator<=(Key l, Key r)
Definition key.hpp:367
friend constexpr bool operator==(char l, Key r)
Definition key.hpp:319
friend constexpr bool operator<(Key l, std::size_t r)
Definition key.hpp:344
friend constexpr bool operator>(char32_t l, Key r)
Definition key.hpp:361
friend constexpr bool operator==(Key l, Key r)
Definition key.hpp:317
constexpr Key(char val)
Definition key.hpp:287
friend constexpr bool operator!=(Key l, Key r)
Definition key.hpp:327
constexpr Key(const Value &v)
Definition key.hpp:280
std::string name() const
Definition key.cpp:89
friend constexpr bool operator<(std::size_t l, Key r)
Definition key.hpp:345
friend constexpr bool operator!=(std::size_t l, Key r)
Definition key.hpp:335
void append_name(std::string &strOut) const
Definition key.cpp:16
constexpr bool isgraph() const
Definition key.hpp:387
friend constexpr bool operator<=(Key l, std::size_t r)
Definition key.hpp:374
constexpr Key toupper() const
Definition key.hpp:391
constexpr bool isxdigit() const
Definition key.hpp:384
friend constexpr bool operator>(Key l, std::int32_t r)
Definition key.hpp:362
constexpr bool isblank() const
Definition key.hpp:378
friend constexpr bool operator<=(Key l, std::int32_t r)
Definition key.hpp:372
constexpr bool hasCtrlAll() const
Definition key.hpp:400
friend constexpr bool operator>=(Key l, char r)
Definition key.hpp:348
friend constexpr bool operator>=(Key l, std::int32_t r)
Definition key.hpp:352
friend constexpr bool operator<(char32_t l, Key r)
Definition key.hpp:341
friend constexpr bool operator<=(Key l, char32_t r)
Definition key.hpp:370
Key & operator=(char val)
Definition key.hpp:288
friend constexpr bool operator>=(Key l, char32_t r)
Definition key.hpp:350
friend constexpr bool operator>=(char32_t l, Key r)
Definition key.hpp:351
friend constexpr bool operator>(Key l, std::size_t r)
Definition key.hpp:364
constexpr bool hasCtrl() const
Definition key.hpp:403
constexpr bool islower() const
Definition key.hpp:381
constexpr bool isdigit() const
Definition key.hpp:383
friend constexpr bool operator==(std::size_t l, Key r)
Definition key.hpp:325
Key & operator=(std::int32_t val)
Definition key.hpp:295
constexpr bool ispunct() const
Definition key.hpp:386
constexpr bool isalnum() const
Definition key.hpp:385
friend constexpr bool operator>(Key l, char32_t r)
Definition key.hpp:360
friend constexpr bool operator>=(std::int32_t l, Key r)
Definition key.hpp:353
friend constexpr bool operator!=(Key l, char32_t r)
Definition key.hpp:330
friend constexpr bool operator>(char l, Key r)
Definition key.hpp:359
constexpr Key(const Key &key)=default
friend constexpr bool operator==(Key l, char32_t r)
Definition key.hpp:320
friend constexpr bool operator!=(char32_t l, Key r)
Definition key.hpp:331
friend constexpr bool operator<=(Key l, char r)
Definition key.hpp:368
constexpr operator std::int32_t() const
Definition key.hpp:315
Key & operator=(const Key &key)=default
friend constexpr bool operator>(Key l, char r)
Definition key.hpp:358
Key & operator=(const Value &v)
Definition key.hpp:281
friend constexpr bool operator>(std::int32_t l, Key r)
Definition key.hpp:363
friend constexpr bool operator==(Key l, std::int32_t r)
Definition key.hpp:322
friend constexpr bool operator>(std::size_t l, Key r)
Definition key.hpp:365
friend constexpr bool operator<(Key l, char r)
Definition key.hpp:338
constexpr bool hasAlt() const
Definition key.hpp:410
constexpr bool isASCII() const
Definition key.hpp:394
constexpr Key()
Definition key.hpp:276
friend constexpr bool operator>=(std::size_t l, Key r)
Definition key.hpp:355
constexpr bool isalpha() const
Definition key.hpp:382
friend constexpr bool operator!=(Key l, std::size_t r)
Definition key.hpp:334
friend constexpr bool operator<(Key l, Key r)
Definition key.hpp:337
constexpr bool iscntrl() const
Definition key.hpp:377
constexpr bool isprint() const
Definition key.hpp:388
Key & operator=(char32_t val)
Definition key.hpp:309
friend constexpr bool operator!=(char l, Key r)
Definition key.hpp:329
friend constexpr bool operator<(Key l, char32_t r)
Definition key.hpp:340
constexpr Key(char32_t val)
Definition key.hpp:308
std::string str() const
Definition key.cpp:96
std::int32_t value
Definition key.hpp:421
constexpr bool isunicode() const
Definition key.hpp:389
friend constexpr bool operator<=(std::size_t l, Key r)
Definition key.hpp:375
friend constexpr bool operator!=(std::int32_t l, Key r)
Definition key.hpp:333
constexpr bool isupper() const
Definition key.hpp:380
friend constexpr bool operator>=(Key l, std::size_t r)
Definition key.hpp:354
friend constexpr bool operator>(Key l, Key r)
Definition key.hpp:357
constexpr Key tolower() const
Definition key.hpp:390
MetaKey & operator+=(MetaKey::Value r)
Definition key.hpp:58
friend constexpr bool operator>=(MetaKey::Value l, MetaKey r)
Definition key.hpp:72
friend constexpr bool operator>=(MetaKey l, MetaKey r)
Definition key.hpp:70
friend constexpr bool operator==(MetaKey::Value l, MetaKey r)
Definition key.hpp:62
friend constexpr bool operator<=(MetaKey l, MetaKey::Value r)
Definition key.hpp:79
friend constexpr bool operator!=(MetaKey l, MetaKey::Value r)
Definition key.hpp:65
MetaKey & operator=(const Value &v)
Definition key.hpp:34
friend constexpr bool operator<(MetaKey l, MetaKey r)
Definition key.hpp:68
constexpr operator std::int32_t() const
Definition key.hpp:47
friend constexpr bool operator>=(MetaKey l, MetaKey::Value r)
Definition key.hpp:71
friend constexpr bool operator==(MetaKey l, MetaKey::Value r)
Definition key.hpp:61
friend constexpr bool operator!=(MetaKey l, MetaKey r)
Definition key.hpp:64
MetaKey & operator=(const MetaKey &key)=default
friend constexpr bool operator>(MetaKey l, MetaKey r)
Definition key.hpp:74
MetaKey & operator=(std::int32_t val)
Definition key.hpp:41
constexpr MetaKey(const Value &v)
Definition key.hpp:33
friend constexpr MetaKey operator+(MetaKey l, MetaKey r)
Definition key.hpp:52
friend constexpr MetaKey operator+(MetaKey::Value l, MetaKey r)
Definition key.hpp:55
friend constexpr bool operator==(MetaKey l, MetaKey r)
Definition key.hpp:60
constexpr bool hasCtrl() const
Definition key.hpp:50
friend constexpr bool operator<=(MetaKey l, MetaKey r)
Definition key.hpp:78
constexpr MetaKey(const MetaKey &key)=default
friend constexpr MetaKey operator+(MetaKey l, MetaKey::Value r)
Definition key.hpp:54
friend constexpr bool operator<=(MetaKey::Value l, MetaKey r)
Definition key.hpp:80
constexpr MetaKey(std::int32_t val)
Definition key.hpp:40
friend constexpr bool operator>(MetaKey l, MetaKey::Value r)
Definition key.hpp:75
friend constexpr MetaKey operator+(MetaKey::Value l, MetaKey::Value r)
Definition key.hpp:53
MetaKey & operator+=(MetaKey r)
Definition key.hpp:57
friend constexpr bool operator>(MetaKey::Value l, MetaKey r)
Definition key.hpp:76
constexpr bool hasAlt() const
Definition key.hpp:49
std::int32_t value
Definition key.hpp:82
constexpr MetaKey()
Definition key.hpp:29
friend constexpr bool operator!=(MetaKey::Value l, MetaKey r)
Definition key.hpp:66
Definition args.cpp:13
constexpr Key operator+(MetaKey metakey, Key key)
Definition key.hpp:442
constexpr bool operator<=(MetaKey l, Key r)
Definition key.hpp:439
constexpr bool operator>=(MetaKey l, Key r)
Definition key.hpp:433
constexpr bool operator==(Key l, MetaKey r)
Definition key.hpp:424
constexpr bool operator<(MetaKey l, Key r)
Definition key.hpp:427
constexpr bool operator>(MetaKey l, Key r)
Definition key.hpp:436
constexpr bool operator!=(Key l, MetaKey r)
Definition key.hpp:430