diff options
Diffstat (limited to 'quantum/keymap_common.h')
| -rw-r--r-- | quantum/keymap_common.h | 76 |
1 files changed, 39 insertions, 37 deletions
diff --git a/quantum/keymap_common.h b/quantum/keymap_common.h index 1cbe8c61c..91d5c09c1 100644 --- a/quantum/keymap_common.h +++ b/quantum/keymap_common.h | |||
| @@ -163,38 +163,13 @@ extern const uint16_t fn_actions[]; | |||
| 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 |
| 194 | #define KC_LEAD 0x5014 | ||
| 195 | |||
| 196 | |||
| 197 | |||
| 198 | 173 | ||
| 199 | // MAGIC keycodes | 174 | // MAGIC keycodes |
| 200 | #define MAGIC_SWAP_CONTROL_CAPSLOCK 0x5002 | 175 | #define MAGIC_SWAP_CONTROL_CAPSLOCK 0x5002 |
| @@ -239,6 +214,32 @@ extern const uint16_t fn_actions[]; | |||
| 239 | #define MI_ON 0x5028 | 214 | #define MI_ON 0x5028 |
| 240 | #define MI_OFF 0x5029 | 215 | #define MI_OFF 0x5029 |
| 241 | 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 | ||
| 242 | |||
| 242 | // GOTO layer - 16 layers max | 243 | // GOTO layer - 16 layers max |
| 243 | // when: | 244 | // when: |
| 244 | // ON_PRESS = 1 | 245 | // ON_PRESS = 1 |
| @@ -261,6 +262,8 @@ extern const uint16_t fn_actions[]; | |||
| 261 | // One-shot mod | 262 | // One-shot mod |
| 262 | #define OSM(layer) (layer | 0x5600) | 263 | #define OSM(layer) (layer | 0x5600) |
| 263 | 264 | ||
| 265 | // chording is currently at 0x57xx | ||
| 266 | |||
| 264 | // M-od, T-ap - 256 keycode max | 267 | // M-od, T-ap - 256 keycode max |
| 265 | #define MT(mod, kc) (kc | 0x7000 | ((mod & 0xF) << 8)) | 268 | #define MT(mod, kc) (kc | 0x7000 | ((mod & 0xF) << 8)) |
| 266 | #define CTL_T(kc) MT(0x1, kc) | 269 | #define CTL_T(kc) MT(0x1, kc) |
| @@ -276,14 +279,13 @@ extern const uint16_t fn_actions[]; | |||
| 276 | #define KC_HYPR HYPR(KC_NO) | 279 | #define KC_HYPR HYPR(KC_NO) |
| 277 | #define KC_MEH MEH(KC_NO) | 280 | #define KC_MEH MEH(KC_NO) |
| 278 | 281 | ||
| 279 | // L-ayer, T-ap - 256 keycode max, 16 layer max | 282 | #ifdef UNICODE_ENABLE |
| 280 | #define LT(layer, kc) (kc | 0x8000 | ((layer & 0xF) << 8)) | 283 | // For sending unicode codes. |
| 281 | 284 | // You may not send codes over 7FFF -- this supports most of UTF8. | |
| 282 | // For sending unicode codes. | 285 | // To have a key that sends out Œ, go UC(0x0152) |
| 283 | // You may not send codes over 1FFF -- this supports most of UTF8. | 286 | #define UNICODE(n) (n | 0x8000) |
| 284 | // To have a key that sends out Œ, go UC(0x0152) | 287 | #define UC(n) UNICODE(n) |
| 285 | #define UNICODE(n) (n | 0x8000) | 288 | #endif |
| 286 | #define UC(n) UNICODE(n) | ||
| 287 | 289 | ||
| 288 | // For tri-layer | 290 | // For tri-layer |
| 289 | 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); |
