diff options
| author | Ryan <fauxpark@gmail.com> | 2023-07-28 01:29:22 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-27 16:29:22 +0100 |
| commit | 727b1d159771898888e1e710c4641aa2e447051b (patch) | |
| tree | 5bdfe62cb14c156d3e69870b3f8836c116894428 | |
| parent | a954a72103075aa072db3d783cd411de7ff0cbfd (diff) | |
Unicode: move keycode aliases to a separate header (#21613)
| -rw-r--r-- | quantum/unicode/unicode.h | 108 | ||||
| -rw-r--r-- | quantum/unicode/unicode_keycodes.h | 125 |
2 files changed, 126 insertions, 107 deletions
diff --git a/quantum/unicode/unicode.h b/quantum/unicode/unicode.h index ccf475d57c..fc0e9d3d2b 100644 --- a/quantum/unicode/unicode.h +++ b/quantum/unicode/unicode.h | |||
| @@ -17,7 +17,7 @@ | |||
| 17 | #pragma once | 17 | #pragma once |
| 18 | 18 | ||
| 19 | #include <stdint.h> | 19 | #include <stdint.h> |
| 20 | #include "quantum_keycodes.h" | 20 | #include "unicode_keycodes.h" |
| 21 | 21 | ||
| 22 | typedef union { | 22 | typedef union { |
| 23 | uint8_t raw; | 23 | uint8_t raw; |
| @@ -59,109 +59,3 @@ void register_hex32(uint32_t hex); | |||
| 59 | void register_unicode(uint32_t code_point); | 59 | void register_unicode(uint32_t code_point); |
| 60 | 60 | ||
| 61 | void send_unicode_string(const char *str); | 61 | void send_unicode_string(const char *str); |
| 62 | |||
| 63 | // clang-format off | ||
| 64 | |||
| 65 | #define UC_BSPC UC(0x0008) // (backspace) | ||
| 66 | |||
| 67 | #define UC_SPC UC(0x0020) // (space) | ||
| 68 | #define UC_EXLM UC(0x0021) // ! | ||
| 69 | #define UC_DQUT UC(0x0022) // " | ||
| 70 | #define UC_HASH UC(0x0023) // # | ||
| 71 | #define UC_DLR UC(0x0024) // $ | ||
| 72 | #define UC_PERC UC(0x0025) // % | ||
| 73 | #define UC_AMPR UC(0x0026) // & | ||
| 74 | #define UC_QUOT UC(0x0027) // ' | ||
| 75 | #define UC_LPRN UC(0x0028) // ( | ||
| 76 | #define UC_RPRN UC(0x0029) // ) | ||
| 77 | #define UC_ASTR UC(0x002A) // * | ||
| 78 | #define UC_PLUS UC(0x002B) // + | ||
| 79 | #define UC_COMM UC(0x002C) // , | ||
| 80 | #define UC_DASH UC(0x002D) // - | ||
| 81 | #define UC_DOT UC(0x002E) // . | ||
| 82 | #define UC_SLSH UC(0x002F) // / | ||
| 83 | |||
| 84 | #define UC_0 UC(0x0030) // 0 | ||
| 85 | #define UC_1 UC(0x0031) // 1 | ||
| 86 | #define UC_2 UC(0x0032) // 2 | ||
| 87 | #define UC_3 UC(0x0033) // 3 | ||
| 88 | #define UC_4 UC(0x0034) // 4 | ||
| 89 | #define UC_5 UC(0x0035) // 5 | ||
| 90 | #define UC_6 UC(0x0036) // 6 | ||
| 91 | #define UC_7 UC(0x0037) // 7 | ||
| 92 | #define UC_8 UC(0x0038) // 8 | ||
| 93 | #define UC_9 UC(0x0039) // 9 | ||
| 94 | #define UC_COLN UC(0x003A) // : | ||
| 95 | #define UC_SCLN UC(0x003B) // ; | ||
| 96 | #define UC_LT UC(0x003C) // < | ||
| 97 | #define UC_EQL UC(0x003D) // = | ||
| 98 | #define UC_GT UC(0x003E) // > | ||
| 99 | #define UC_QUES UC(0x003F) // ? | ||
| 100 | |||
| 101 | #define UC_AT UC(0x0040) // @ | ||
| 102 | #define UC_A UC(0x0041) // A | ||
| 103 | #define UC_B UC(0x0042) // B | ||
| 104 | #define UC_C UC(0x0043) // C | ||
| 105 | #define UC_D UC(0x0044) // D | ||
| 106 | #define UC_E UC(0x0045) // E | ||
| 107 | #define UC_F UC(0x0046) // F | ||
| 108 | #define UC_G UC(0x0047) // G | ||
| 109 | #define UC_H UC(0x0048) // H | ||
| 110 | #define UC_I UC(0x0049) // I | ||
| 111 | #define UC_J UC(0x004A) // J | ||
| 112 | #define UC_K UC(0x004B) // K | ||
| 113 | #define UC_L UC(0x004C) // L | ||
| 114 | #define UC_M UC(0x004D) // M | ||
| 115 | #define UC_N UC(0x004E) // N | ||
| 116 | #define UC_O UC(0x004F) // O | ||
| 117 | |||
| 118 | #define UC_P UC(0x0050) // P | ||
| 119 | #define UC_Q UC(0x0051) // Q | ||
| 120 | #define UC_R UC(0x0052) // R | ||
| 121 | #define UC_S UC(0x0053) // S | ||
| 122 | #define UC_T UC(0x0054) // T | ||
| 123 | #define UC_U UC(0x0055) // U | ||
| 124 | #define UC_V UC(0x0056) // V | ||
| 125 | #define UC_W UC(0x0057) // W | ||
| 126 | #define UC_X UC(0x0058) // X | ||
| 127 | #define UC_Y UC(0x0059) // Y | ||
| 128 | #define UC_Z UC(0x005A) // Z | ||
| 129 | #define UC_LBRC UC(0x005B) // [ | ||
| 130 | #define UC_BSLS UC(0x005C) // (backslash) | ||
| 131 | #define UC_RBRC UC(0x005D) // ] | ||
| 132 | #define UC_CIRM UC(0x005E) // ^ | ||
| 133 | #define UC_UNDR UC(0x005F) // _ | ||
| 134 | |||
| 135 | #define UC_GRV UC(0x0060) // ` | ||
| 136 | #define UC_a UC(0x0061) // a | ||
| 137 | #define UC_b UC(0x0062) // b | ||
| 138 | #define UC_c UC(0x0063) // c | ||
| 139 | #define UC_d UC(0x0064) // d | ||
| 140 | #define UC_e UC(0x0065) // e | ||
| 141 | #define UC_f UC(0x0066) // f | ||
| 142 | #define UC_g UC(0x0067) // g | ||
| 143 | #define UC_h UC(0x0068) // h | ||
| 144 | #define UC_i UC(0x0069) // i | ||
| 145 | #define UC_j UC(0x006A) // j | ||
| 146 | #define UC_k UC(0x006B) // k | ||
| 147 | #define UC_l UC(0x006C) // l | ||
| 148 | #define UC_m UC(0x006D) // m | ||
| 149 | #define UC_n UC(0x006E) // n | ||
| 150 | #define UC_o UC(0x006F) // o | ||
| 151 | |||
| 152 | #define UC_p UC(0x0070) // p | ||
| 153 | #define UC_q UC(0x0071) // q | ||
| 154 | #define UC_r UC(0x0072) // r | ||
| 155 | #define UC_s UC(0x0073) // s | ||
| 156 | #define UC_t UC(0x0074) // t | ||
| 157 | #define UC_u UC(0x0075) // u | ||
| 158 | #define UC_v UC(0x0076) // v | ||
| 159 | #define UC_w UC(0x0077) // w | ||
| 160 | #define UC_x UC(0x0078) // x | ||
| 161 | #define UC_y UC(0x0079) // y | ||
| 162 | #define UC_z UC(0x007A) // z | ||
| 163 | #define UC_LCBR UC(0x007B) // { | ||
| 164 | #define UC_PIPE UC(0x007C) // | | ||
| 165 | #define UC_RCBR UC(0x007D) // } | ||
| 166 | #define UC_TILD UC(0x007E) // ~ | ||
| 167 | #define UC_DEL UC(0x007F) // (delete) | ||
diff --git a/quantum/unicode/unicode_keycodes.h b/quantum/unicode/unicode_keycodes.h new file mode 100644 index 0000000000..acc176cb6f --- /dev/null +++ b/quantum/unicode/unicode_keycodes.h | |||
| @@ -0,0 +1,125 @@ | |||
| 1 | /* Copyright 2023 QMK | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #pragma once | ||
| 18 | |||
| 19 | #include "quantum_keycodes.h" | ||
| 20 | |||
| 21 | // clang-format off | ||
| 22 | |||
| 23 | #define UC_BSPC UC(0x0008) // (backspace) | ||
| 24 | |||
| 25 | #define UC_SPC UC(0x0020) // (space) | ||
| 26 | #define UC_EXLM UC(0x0021) // ! | ||
| 27 | #define UC_DQUT UC(0x0022) // " | ||
| 28 | #define UC_HASH UC(0x0023) // # | ||
| 29 | #define UC_DLR UC(0x0024) // $ | ||
| 30 | #define UC_PERC UC(0x0025) // % | ||
| 31 | #define UC_AMPR UC(0x0026) // & | ||
| 32 | #define UC_QUOT UC(0x0027) // ' | ||
| 33 | #define UC_LPRN UC(0x0028) // ( | ||
| 34 | #define UC_RPRN UC(0x0029) // ) | ||
| 35 | #define UC_ASTR UC(0x002A) // * | ||
| 36 | #define UC_PLUS UC(0x002B) // + | ||
| 37 | #define UC_COMM UC(0x002C) // , | ||
| 38 | #define UC_DASH UC(0x002D) // - | ||
| 39 | #define UC_DOT UC(0x002E) // . | ||
| 40 | #define UC_SLSH UC(0x002F) // / | ||
| 41 | |||
| 42 | #define UC_0 UC(0x0030) // 0 | ||
| 43 | #define UC_1 UC(0x0031) // 1 | ||
| 44 | #define UC_2 UC(0x0032) // 2 | ||
| 45 | #define UC_3 UC(0x0033) // 3 | ||
| 46 | #define UC_4 UC(0x0034) // 4 | ||
| 47 | #define UC_5 UC(0x0035) // 5 | ||
| 48 | #define UC_6 UC(0x0036) // 6 | ||
| 49 | #define UC_7 UC(0x0037) // 7 | ||
| 50 | #define UC_8 UC(0x0038) // 8 | ||
| 51 | #define UC_9 UC(0x0039) // 9 | ||
| 52 | #define UC_COLN UC(0x003A) // : | ||
| 53 | #define UC_SCLN UC(0x003B) // ; | ||
| 54 | #define UC_LT UC(0x003C) // < | ||
| 55 | #define UC_EQL UC(0x003D) // = | ||
| 56 | #define UC_GT UC(0x003E) // > | ||
| 57 | #define UC_QUES UC(0x003F) // ? | ||
| 58 | |||
| 59 | #define UC_AT UC(0x0040) // @ | ||
| 60 | #define UC_A UC(0x0041) // A | ||
| 61 | #define UC_B UC(0x0042) // B | ||
| 62 | #define UC_C UC(0x0043) // C | ||
| 63 | #define UC_D UC(0x0044) // D | ||
| 64 | #define UC_E UC(0x0045) // E | ||
| 65 | #define UC_F UC(0x0046) // F | ||
| 66 | #define UC_G UC(0x0047) // G | ||
| 67 | #define UC_H UC(0x0048) // H | ||
| 68 | #define UC_I UC(0x0049) // I | ||
| 69 | #define UC_J UC(0x004A) // J | ||
| 70 | #define UC_K UC(0x004B) // K | ||
| 71 | #define UC_L UC(0x004C) // L | ||
| 72 | #define UC_M UC(0x004D) // M | ||
| 73 | #define UC_N UC(0x004E) // N | ||
| 74 | #define UC_O UC(0x004F) // O | ||
| 75 | |||
| 76 | #define UC_P UC(0x0050) // P | ||
| 77 | #define UC_Q UC(0x0051) // Q | ||
| 78 | #define UC_R UC(0x0052) // R | ||
| 79 | #define UC_S UC(0x0053) // S | ||
| 80 | #define UC_T UC(0x0054) // T | ||
| 81 | #define UC_U UC(0x0055) // U | ||
| 82 | #define UC_V UC(0x0056) // V | ||
| 83 | #define UC_W UC(0x0057) // W | ||
| 84 | #define UC_X UC(0x0058) // X | ||
| 85 | #define UC_Y UC(0x0059) // Y | ||
| 86 | #define UC_Z UC(0x005A) // Z | ||
| 87 | #define UC_LBRC UC(0x005B) // [ | ||
| 88 | #define UC_BSLS UC(0x005C) // (backslash) | ||
| 89 | #define UC_RBRC UC(0x005D) // ] | ||
| 90 | #define UC_CIRM UC(0x005E) // ^ | ||
| 91 | #define UC_UNDR UC(0x005F) // _ | ||
| 92 | |||
| 93 | #define UC_GRV UC(0x0060) // ` | ||
| 94 | #define UC_a UC(0x0061) // a | ||
| 95 | #define UC_b UC(0x0062) // b | ||
| 96 | #define UC_c UC(0x0063) // c | ||
| 97 | #define UC_d UC(0x0064) // d | ||
| 98 | #define UC_e UC(0x0065) // e | ||
| 99 | #define UC_f UC(0x0066) // f | ||
| 100 | #define UC_g UC(0x0067) // g | ||
| 101 | #define UC_h UC(0x0068) // h | ||
| 102 | #define UC_i UC(0x0069) // i | ||
| 103 | #define UC_j UC(0x006A) // j | ||
| 104 | #define UC_k UC(0x006B) // k | ||
| 105 | #define UC_l UC(0x006C) // l | ||
| 106 | #define UC_m UC(0x006D) // m | ||
| 107 | #define UC_n UC(0x006E) // n | ||
| 108 | #define UC_o UC(0x006F) // o | ||
| 109 | |||
| 110 | #define UC_p UC(0x0070) // p | ||
| 111 | #define UC_q UC(0x0071) // q | ||
| 112 | #define UC_r UC(0x0072) // r | ||
| 113 | #define UC_s UC(0x0073) // s | ||
| 114 | #define UC_t UC(0x0074) // t | ||
| 115 | #define UC_u UC(0x0075) // u | ||
| 116 | #define UC_v UC(0x0076) // v | ||
| 117 | #define UC_w UC(0x0077) // w | ||
| 118 | #define UC_x UC(0x0078) // x | ||
| 119 | #define UC_y UC(0x0079) // y | ||
| 120 | #define UC_z UC(0x007A) // z | ||
| 121 | #define UC_LCBR UC(0x007B) // { | ||
| 122 | #define UC_PIPE UC(0x007C) // | | ||
| 123 | #define UC_RCBR UC(0x007D) // } | ||
| 124 | #define UC_TILD UC(0x007E) // ~ | ||
| 125 | #define UC_DEL UC(0x007F) // (delete) | ||
