aboutsummaryrefslogtreecommitdiff
path: root/users/konstantin/unicode.h
diff options
context:
space:
mode:
authorKonstantin Đorđević <vomindoraan@gmail.com>2019-02-11 23:21:41 +0100
committerKonstantin Đorđević <vomindoraan@gmail.com>2019-03-02 15:15:55 +0100
commitddb0f39ebf317c7a23c69ed45efb1882746a01b0 (patch)
tree1395072c58d02ebcda3d87c0c28401581695062c /users/konstantin/unicode.h
parent2f07627a5dd38ab1370804f4feb1972250928803 (diff)
downloadqmk_firmware-ddb0f39ebf317c7a23c69ed45efb1882746a01b0.tar.gz
qmk_firmware-ddb0f39ebf317c7a23c69ed45efb1882746a01b0.zip
Generate UNICODE and UNICODEMAP constants using macros
Diffstat (limited to 'users/konstantin/unicode.h')
-rw-r--r--users/konstantin/unicode.h37
1 files changed, 30 insertions, 7 deletions
diff --git a/users/konstantin/unicode.h b/users/konstantin/unicode.h
index 09af7e1c7..d76f2a170 100644
--- a/users/konstantin/unicode.h
+++ b/users/konstantin/unicode.h
@@ -2,10 +2,33 @@
2 2
3#include "quantum.h" 3#include "quantum.h"
4 4
5#define COMMA UC(0x002C) 5#define FOREACH_UNICODE(M) \
6#define L_PAREN UC(0x0028) 6 M(COMMA, 0x002C) \
7#define R_PAREN UC(0x0029) 7 M(L_PAREN, 0x0028) \
8#define EQUALS UC(0x003D) 8 M(R_PAREN, 0x0029) \
9#define TIMES UC(0x00D7) 9 M(EQUALS, 0x003D) \
10#define DIVIDE UC(0x00F7) 10 M(TIMES, 0x00D7) \
11#define MINUS UC(0x2212) 11 M(DIVIDE, 0x00F7) \
12 M(MINUS, 0x2212)
13
14#define UC_KEYCODE(name, code) name = UC(code),
15
16#define X_NAME(name, code) X_ ## name,
17#define X_ENTRY(name, code) [X_ ## name] = code,
18#define X_KEYCODE(name, code) name = X(X_ ## name),
19
20#if defined(UNICODE_ENABLE)
21 enum unicode_keycodes {
22 FOREACH_UNICODE(UC_KEYCODE)
23 };
24#elif defined(UNICODEMAP_ENABLE)
25 enum unicode_names {
26 FOREACH_UNICODE(X_NAME)
27 };
28
29 extern const uint32_t PROGMEM unicode_map[];
30
31 enum unicode_keycodes {
32 FOREACH_UNICODE(X_KEYCODE)
33 };
34#endif