diff options
Diffstat (limited to 'quantum/keymap_common.h')
| -rw-r--r-- | quantum/keymap_common.h | 93 |
1 files changed, 59 insertions, 34 deletions
diff --git a/quantum/keymap_common.h b/quantum/keymap_common.h index 322fda498..91d5c09c1 100644 --- a/quantum/keymap_common.h +++ b/quantum/keymap_common.h | |||
| @@ -159,35 +159,14 @@ extern const uint16_t fn_actions[]; | |||
| 159 | #define S(kc) LSFT(kc) | 159 | #define S(kc) LSFT(kc) |
| 160 | #define F(kc) FUNC(kc) | 160 | #define F(kc) FUNC(kc) |
| 161 | 161 | ||
| 162 | #define M(kc) kc | 0x3000 | 162 | #define M(kc) (kc | 0x3000) |
| 163 | 163 | ||
| 164 | #define MACRODOWN(...) (record->event.pressed ? MACRO(__VA_ARGS__) : MACRO_NONE) | 164 | #define MACRODOWN(...) (record->event.pressed ? MACRO(__VA_ARGS__) : MACRO_NONE) |
| 165 | 165 | ||
| 166 | // These affect the backlight (if your keyboard has one). | 166 | // 0x3100+ is free |
| 167 | // We don't need to comment them out if your keyboard doesn't have a backlight, | 167 | |
| 168 | // since they don't take up any space. | 168 | // L-ayer, T-ap - 256 keycode max, 16 layer max |
| 169 | #define BL_ON 0x4009 | 169 | #define LT(layer, kc) (kc | 0x4000 | ((layer & 0xF) << 8)) |
| 170 | #define BL_OFF 0x4000 | ||
| 171 | #define BL_0 0x4000 | ||
| 172 | #define BL_1 0x4001 | ||
| 173 | #define BL_2 0x4002 | ||
| 174 | #define BL_3 0x4003 | ||
| 175 | #define BL_4 0x4004 | ||
| 176 | #define BL_5 0x4005 | ||
| 177 | #define BL_6 0x4006 | ||
| 178 | #define BL_7 0x4007 | ||
| 179 | #define BL_8 0x4008 | ||
| 180 | #define BL_9 0x4009 | ||
| 181 | #define BL_10 0x400A | ||
| 182 | #define BL_11 0x400B | ||
| 183 | #define BL_12 0x400C | ||
| 184 | #define BL_13 0x400D | ||
| 185 | #define BL_14 0x400E | ||
| 186 | #define BL_15 0x400F | ||
| 187 | #define BL_DEC 0x4010 | ||
| 188 | #define BL_INC 0x4011 | ||
| 189 | #define BL_TOGG 0x4012 | ||
| 190 | #define BL_STEP 0x4013 | ||
| 191 | 170 | ||
| 192 | #define RESET 0x5000 | 171 | #define RESET 0x5000 |
| 193 | #define DEBUG 0x5001 | 172 | #define DEBUG 0x5001 |
| @@ -215,6 +194,51 @@ extern const uint16_t fn_actions[]; | |||
| 215 | #define AG_SWAP MAGIC_SWAP_ALT_GUI | 194 | #define AG_SWAP MAGIC_SWAP_ALT_GUI |
| 216 | #define AG_NORM MAGIC_UNSWAP_ALT_GUI | 195 | #define AG_NORM MAGIC_UNSWAP_ALT_GUI |
| 217 | 196 | ||
| 197 | #define KC_LEAD 0x5014 | ||
| 198 | |||
| 199 | // Audio on/off | ||
| 200 | #define AU_ON 0x5020 | ||
| 201 | #define AU_OFF 0x5021 | ||
| 202 | #define AU_TOG 0x5022 | ||
| 203 | |||
| 204 | // Music mode on/off | ||
| 205 | #define MU_ON 0x5023 | ||
| 206 | #define MU_OFF 0x5024 | ||
| 207 | #define MU_TOG 0x5025 | ||
| 208 | |||
| 209 | // Music voice iterate | ||
| 210 | #define MUV_IN 0x5026 | ||
| 211 | #define MUV_DE 0x5027 | ||
| 212 | |||
| 213 | // Midi mode on/off | ||
| 214 | #define MI_ON 0x5028 | ||
| 215 | #define MI_OFF 0x5029 | ||
| 216 | |||
| 217 | // These affect the backlight (if your keyboard has one). | ||
| 218 | // We don't need to comment them out if your keyboard doesn't have a backlight, | ||
| 219 | // since they don't take up any space. | ||
| 220 | #define BL_ON 0x5079 | ||
| 221 | #define BL_OFF 0x5070 | ||
| 222 | #define BL_0 0x5070 | ||
| 223 | #define BL_1 0x5071 | ||
| 224 | #define BL_2 0x5072 | ||
| 225 | #define BL_3 0x5073 | ||
| 226 | #define BL_4 0x5074 | ||
| 227 | #define BL_5 0x5075 | ||
| 228 | #define BL_6 0x5076 | ||
| 229 | #define BL_7 0x5077 | ||
| 230 | #define BL_8 0x5078 | ||
| 231 | #define BL_9 0x5079 | ||
| 232 | #define BL_10 0x507A | ||
| 233 | #define BL_11 0x507B | ||
| 234 | #define BL_12 0x507C | ||
| 235 | #define BL_13 0x507D | ||
| 236 | #define BL_14 0x507E | ||
| 237 | #define BL_15 0x507F | ||
| 238 | #define BL_DEC 0x5080 | ||
| 239 | #define BL_INC 0x5081 | ||
| 240 | #define BL_TOGG 0x5082 | ||
| 241 | #define BL_STEP 0x5083 | ||
| 218 | 242 | ||
| 219 | // GOTO layer - 16 layers max | 243 | // GOTO layer - 16 layers max |
| 220 | // when: | 244 | // when: |
| @@ -238,6 +262,8 @@ extern const uint16_t fn_actions[]; | |||
| 238 | // One-shot mod | 262 | // One-shot mod |
| 239 | #define OSM(layer) (layer | 0x5600) | 263 | #define OSM(layer) (layer | 0x5600) |
| 240 | 264 | ||
| 265 | // chording is currently at 0x57xx | ||
| 266 | |||
| 241 | // M-od, T-ap - 256 keycode max | 267 | // M-od, T-ap - 256 keycode max |
| 242 | #define MT(mod, kc) (kc | 0x7000 | ((mod & 0xF) << 8)) | 268 | #define MT(mod, kc) (kc | 0x7000 | ((mod & 0xF) << 8)) |
| 243 | #define CTL_T(kc) MT(0x1, kc) | 269 | #define CTL_T(kc) MT(0x1, kc) |
| @@ -253,14 +279,13 @@ extern const uint16_t fn_actions[]; | |||
| 253 | #define KC_HYPR HYPR(KC_NO) | 279 | #define KC_HYPR HYPR(KC_NO) |
| 254 | #define KC_MEH MEH(KC_NO) | 280 | #define KC_MEH MEH(KC_NO) |
| 255 | 281 | ||
| 256 | // L-ayer, T-ap - 256 keycode max, 16 layer max | 282 | #ifdef UNICODE_ENABLE |
| 257 | #define LT(layer, kc) (kc | 0x8000 | ((layer & 0xF) << 8)) | 283 | // For sending unicode codes. |
| 258 | 284 | // You may not send codes over 7FFF -- this supports most of UTF8. | |
| 259 | // For sending unicode codes. | 285 | // To have a key that sends out Œ, go UC(0x0152) |
| 260 | // You may not send codes over 1FFF -- this supports most of UTF8. | 286 | #define UNICODE(n) (n | 0x8000) |
| 261 | // To have a key that sends out Œ, go UC(0x0152) | 287 | #define UC(n) UNICODE(n) |
| 262 | #define UNICODE(n) (n | 0x8000) | 288 | #endif |
| 263 | #define UC(n) UNICODE(n) | ||
| 264 | 289 | ||
| 265 | // For tri-layer | 290 | // For tri-layer |
| 266 | void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3); | 291 | void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3); |
