diff options
Diffstat (limited to 'users/konstantin/unicode.h')
| -rw-r--r-- | users/konstantin/unicode.h | 37 |
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 | ||
