diff options
| author | Konstantin Đorđević <vomindoraan@gmail.com> | 2019-02-18 07:23:32 +0100 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2019-02-17 22:23:32 -0800 |
| commit | 5cb713148dbc319167517df370ca9dd774ceb31c (patch) | |
| tree | ad6b4cfc283b135cb93bb1f539dc8a0fade65a54 /tmk_core | |
| parent | 4e2369693f7f2ef654db35d158af5cddb98d9703 (diff) | |
| download | qmk_firmware-5cb713148dbc319167517df370ca9dd774ceb31c.tar.gz qmk_firmware-5cb713148dbc319167517df370ca9dd774ceb31c.zip | |
Change Command keycode defaults to match corresponding Bootmagic codes (#5078)
* Change Command keycode defaults to match corresponding Bootmagic codes
* Make alternate magic key keycodes consistent
* Reflect changes from previous commit in tmk_core/common/command.c
* Remove unnecessary MAGIC_KEY_* definitions from keymaps compatible with these changes
* Swap E and BSPACE for MAGIC_KEY_EEPROM
* Add MAGIC_KEY_EEPROM_CLEAR instead of MAGIC_KEY_EEPROM_ALT
* Remove BOOTMAGIC_ENABLE checks around EECONFIG stuff
* Update Command descriptions
Diffstat (limited to 'tmk_core')
| -rw-r--r-- | tmk_core/common/command.c | 31 | ||||
| -rw-r--r-- | tmk_core/common/command.h | 34 |
2 files changed, 35 insertions, 30 deletions
diff --git a/tmk_core/common/command.c b/tmk_core/common/command.c index aab99290d..d3884d9fa 100644 --- a/tmk_core/common/command.c +++ b/tmk_core/common/command.c | |||
| @@ -151,17 +151,17 @@ static void command_common_help(void) | |||
| 151 | "0-9: Switch to Layer 0-9\n" | 151 | "0-9: Switch to Layer 0-9\n" |
| 152 | #endif | 152 | #endif |
| 153 | 153 | ||
| 154 | STR(MAGIC_KEY_LAYER0_ALT1 ) ": Switch to Layer 0 (alternate key 1)\n" | 154 | STR(MAGIC_KEY_LAYER0_ALT ) ": Switch to Layer 0 (alternate)\n" |
| 155 | STR(MAGIC_KEY_LAYER0_ALT2 ) ": Switch to Layer 0 (alternate key 2)\n" | 155 | |
| 156 | STR(MAGIC_KEY_BOOTLOADER ) ": Jump to Bootloader (Reset)\n" | 156 | STR(MAGIC_KEY_BOOTLOADER ) ": Jump to Bootloader\n" |
| 157 | STR(MAGIC_KEY_BOOTLOADER_ALT) ": Jump to Bootloader (alternate)\n" | ||
| 157 | 158 | ||
| 158 | #ifdef KEYBOARD_LOCK_ENABLE | 159 | #ifdef KEYBOARD_LOCK_ENABLE |
| 159 | STR(MAGIC_KEY_LOCK ) ": Lock\n" | 160 | STR(MAGIC_KEY_LOCK ) ": Lock Keyboard\n" |
| 160 | #endif | 161 | #endif |
| 161 | 162 | ||
| 162 | #ifdef BOOTMAGIC_ENABLE | ||
| 163 | STR(MAGIC_KEY_EEPROM ) ": Print EEPROM Settings\n" | 163 | STR(MAGIC_KEY_EEPROM ) ": Print EEPROM Settings\n" |
| 164 | #endif | 164 | STR(MAGIC_KEY_EEPROM_CLEAR) ": Clear EEPROM\n" |
| 165 | 165 | ||
| 166 | #ifdef NKRO_ENABLE | 166 | #ifdef NKRO_ENABLE |
| 167 | STR(MAGIC_KEY_NKRO ) ": NKRO Toggle\n" | 167 | STR(MAGIC_KEY_NKRO ) ": NKRO Toggle\n" |
| @@ -265,7 +265,6 @@ static void print_status(void) | |||
| 265 | return; | 265 | return; |
| 266 | } | 266 | } |
| 267 | 267 | ||
| 268 | #ifdef BOOTMAGIC_ENABLE | ||
| 269 | static void print_eeconfig(void) | 268 | static void print_eeconfig(void) |
| 270 | { | 269 | { |
| 271 | 270 | ||
| @@ -305,7 +304,6 @@ static void print_eeconfig(void) | |||
| 305 | #endif /* !NO_PRINT */ | 304 | #endif /* !NO_PRINT */ |
| 306 | 305 | ||
| 307 | } | 306 | } |
| 308 | #endif /* BOOTMAGIC_ENABLE */ | ||
| 309 | 307 | ||
| 310 | static bool command_common(uint8_t code) | 308 | static bool command_common(uint8_t code) |
| 311 | { | 309 | { |
| @@ -326,14 +324,17 @@ static bool command_common(uint8_t code) | |||
| 326 | break; | 324 | break; |
| 327 | #endif | 325 | #endif |
| 328 | 326 | ||
| 329 | #ifdef BOOTMAGIC_ENABLE | ||
| 330 | |||
| 331 | // print stored eeprom config | 327 | // print stored eeprom config |
| 332 | case MAGIC_KC(MAGIC_KEY_EEPROM): | 328 | case MAGIC_KC(MAGIC_KEY_EEPROM): |
| 333 | print("eeconfig:\n"); | 329 | print("eeconfig:\n"); |
| 334 | print_eeconfig(); | 330 | print_eeconfig(); |
| 335 | break; | 331 | break; |
| 336 | #endif | 332 | |
| 333 | // clear eeprom | ||
| 334 | case MAGIC_KC(MAGIC_KEY_EEPROM_CLEAR): | ||
| 335 | print("Clearing EEPROM\n"); | ||
| 336 | eeconfig_init(); | ||
| 337 | break; | ||
| 337 | 338 | ||
| 338 | #ifdef KEYBOARD_LOCK_ENABLE | 339 | #ifdef KEYBOARD_LOCK_ENABLE |
| 339 | 340 | ||
| @@ -352,8 +353,8 @@ static bool command_common(uint8_t code) | |||
| 352 | #endif | 353 | #endif |
| 353 | 354 | ||
| 354 | // print help | 355 | // print help |
| 355 | case MAGIC_KC(MAGIC_KEY_HELP1): | 356 | case MAGIC_KC(MAGIC_KEY_HELP): |
| 356 | case MAGIC_KC(MAGIC_KEY_HELP2): | 357 | case MAGIC_KC(MAGIC_KEY_HELP_ALT): |
| 357 | command_common_help(); | 358 | command_common_help(); |
| 358 | break; | 359 | break; |
| 359 | 360 | ||
| @@ -370,6 +371,7 @@ static bool command_common(uint8_t code) | |||
| 370 | 371 | ||
| 371 | // jump to bootloader | 372 | // jump to bootloader |
| 372 | case MAGIC_KC(MAGIC_KEY_BOOTLOADER): | 373 | case MAGIC_KC(MAGIC_KEY_BOOTLOADER): |
| 374 | case MAGIC_KC(MAGIC_KEY_BOOTLOADER_ALT): | ||
| 373 | clear_keyboard(); // clear to prevent stuck keys | 375 | clear_keyboard(); // clear to prevent stuck keys |
| 374 | print("\n\nJumping to bootloader... "); | 376 | print("\n\nJumping to bootloader... "); |
| 375 | #ifdef AUDIO_ENABLE | 377 | #ifdef AUDIO_ENABLE |
| @@ -453,8 +455,7 @@ static bool command_common(uint8_t code) | |||
| 453 | 455 | ||
| 454 | // switch layers | 456 | // switch layers |
| 455 | 457 | ||
| 456 | case MAGIC_KC(MAGIC_KEY_LAYER0_ALT1): | 458 | case MAGIC_KC(MAGIC_KEY_LAYER0_ALT): |
| 457 | case MAGIC_KC(MAGIC_KEY_LAYER0_ALT2): | ||
| 458 | switch_default_layer(0); | 459 | switch_default_layer(0); |
| 459 | break; | 460 | break; |
| 460 | 461 | ||
diff --git a/tmk_core/common/command.h b/tmk_core/common/command.h index 052e25184..e7c7b0ea1 100644 --- a/tmk_core/common/command.h +++ b/tmk_core/common/command.h | |||
| @@ -50,12 +50,12 @@ bool command_proc(uint8_t code); | |||
| 50 | #define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false | 50 | #define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false |
| 51 | #endif | 51 | #endif |
| 52 | 52 | ||
| 53 | #ifndef MAGIC_KEY_HELP1 | 53 | #ifndef MAGIC_KEY_HELP |
| 54 | #define MAGIC_KEY_HELP1 H | 54 | #define MAGIC_KEY_HELP H |
| 55 | #endif | 55 | #endif |
| 56 | 56 | ||
| 57 | #ifndef MAGIC_KEY_HELP2 | 57 | #ifndef MAGIC_KEY_HELP_ALT |
| 58 | #define MAGIC_KEY_HELP2 SLASH | 58 | #define MAGIC_KEY_HELP_ALT SLASH |
| 59 | #endif | 59 | #endif |
| 60 | 60 | ||
| 61 | #ifndef MAGIC_KEY_DEBUG | 61 | #ifndef MAGIC_KEY_DEBUG |
| @@ -86,18 +86,14 @@ bool command_proc(uint8_t code); | |||
| 86 | #define MAGIC_KEY_CONSOLE C | 86 | #define MAGIC_KEY_CONSOLE C |
| 87 | #endif | 87 | #endif |
| 88 | 88 | ||
| 89 | #ifndef MAGIC_KEY_LAYER0_ALT1 | ||
| 90 | #define MAGIC_KEY_LAYER0_ALT1 ESC | ||
| 91 | #endif | ||
| 92 | |||
| 93 | #ifndef MAGIC_KEY_LAYER0_ALT2 | ||
| 94 | #define MAGIC_KEY_LAYER0_ALT2 GRAVE | ||
| 95 | #endif | ||
| 96 | |||
| 97 | #ifndef MAGIC_KEY_LAYER0 | 89 | #ifndef MAGIC_KEY_LAYER0 |
| 98 | #define MAGIC_KEY_LAYER0 0 | 90 | #define MAGIC_KEY_LAYER0 0 |
| 99 | #endif | 91 | #endif |
| 100 | 92 | ||
| 93 | #ifndef MAGIC_KEY_LAYER0_ALT | ||
| 94 | #define MAGIC_KEY_LAYER0_ALT GRAVE | ||
| 95 | #endif | ||
| 96 | |||
| 101 | #ifndef MAGIC_KEY_LAYER1 | 97 | #ifndef MAGIC_KEY_LAYER1 |
| 102 | #define MAGIC_KEY_LAYER1 1 | 98 | #define MAGIC_KEY_LAYER1 1 |
| 103 | #endif | 99 | #endif |
| @@ -135,7 +131,11 @@ bool command_proc(uint8_t code); | |||
| 135 | #endif | 131 | #endif |
| 136 | 132 | ||
| 137 | #ifndef MAGIC_KEY_BOOTLOADER | 133 | #ifndef MAGIC_KEY_BOOTLOADER |
| 138 | #define MAGIC_KEY_BOOTLOADER PAUSE | 134 | #define MAGIC_KEY_BOOTLOADER B |
| 135 | #endif | ||
| 136 | |||
| 137 | #ifndef MAGIC_KEY_BOOTLOADER_ALT | ||
| 138 | #define MAGIC_KEY_BOOTLOADER_ALT ESC | ||
| 139 | #endif | 139 | #endif |
| 140 | 140 | ||
| 141 | #ifndef MAGIC_KEY_LOCK | 141 | #ifndef MAGIC_KEY_LOCK |
| @@ -146,6 +146,10 @@ bool command_proc(uint8_t code); | |||
| 146 | #define MAGIC_KEY_EEPROM E | 146 | #define MAGIC_KEY_EEPROM E |
| 147 | #endif | 147 | #endif |
| 148 | 148 | ||
| 149 | #ifndef MAGIC_KEY_EEPROM_CLEAR | ||
| 150 | #define MAGIC_KEY_EEPROM_CLEAR BSPACE | ||
| 151 | #endif | ||
| 152 | |||
| 149 | #ifndef MAGIC_KEY_NKRO | 153 | #ifndef MAGIC_KEY_NKRO |
| 150 | #define MAGIC_KEY_NKRO N | 154 | #define MAGIC_KEY_NKRO N |
| 151 | #endif | 155 | #endif |
| @@ -155,5 +159,5 @@ bool command_proc(uint8_t code); | |||
| 155 | 159 | ||
| 156 | #endif | 160 | #endif |
| 157 | 161 | ||
| 158 | #define XMAGIC_KC(key) KC_##key | 162 | #define XMAGIC_KC(key) KC_ ## key |
| 159 | #define MAGIC_KC(key) XMAGIC_KC(key) | 163 | #define MAGIC_KC(key) XMAGIC_KC(key) |
