X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=tmk_core%2Fcommon%2Fcommand.h;h=e7c7b0ea1d2296c692b440d849ecc46edffc7fd1;hb=7d557a0514e2cef42a3d460f6cc78771b5df0a30;hp=92b18849bf31dcaeac1918084c0cb93503af8259;hpb=535daad3cd812df58f4630df202a447836ac3084;p=qmk_firmware.git diff --git a/tmk_core/common/command.h b/tmk_core/common/command.h index 92b18849b..e7c7b0ea1 100644 --- a/tmk_core/common/command.h +++ b/tmk_core/common/command.h @@ -15,8 +15,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef COMMAND_H -#define COMMAND +#pragma once + +/* FIXME: Add doxygen comments for the behavioral defines in here. */ /* TODO: Refactoring */ typedef enum { ONESHOT, CONSOLE, MOUSEKEY } command_state_t; @@ -27,11 +28,15 @@ bool command_extra(uint8_t code); bool command_console_extra(uint8_t code); #ifdef COMMAND_ENABLE +uint8_t numkey2num(uint8_t code); bool command_proc(uint8_t code); #else #define command_proc(code) false #endif +#ifndef IS_COMMAND +#define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) +#endif #ifndef MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS #define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true @@ -45,12 +50,12 @@ bool command_proc(uint8_t code); #define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false #endif -#ifndef MAGIC_KEY_HELP1 -#define MAGIC_KEY_HELP1 H +#ifndef MAGIC_KEY_HELP +#define MAGIC_KEY_HELP H #endif -#ifndef MAGIC_KEY_HELP2 -#define MAGIC_KEY_HELP2 SLASH +#ifndef MAGIC_KEY_HELP_ALT +#define MAGIC_KEY_HELP_ALT SLASH #endif #ifndef MAGIC_KEY_DEBUG @@ -81,18 +86,14 @@ bool command_proc(uint8_t code); #define MAGIC_KEY_CONSOLE C #endif -#ifndef MAGIC_KEY_LAYER0_ALT1 -#define MAGIC_KEY_LAYER0_ALT1 ESC -#endif - -#ifndef MAGIC_KEY_LAYER0_ALT2 -#define MAGIC_KEY_LAYER0_ALT2 GRAVE -#endif - #ifndef MAGIC_KEY_LAYER0 #define MAGIC_KEY_LAYER0 0 #endif +#ifndef MAGIC_KEY_LAYER0_ALT +#define MAGIC_KEY_LAYER0_ALT GRAVE +#endif + #ifndef MAGIC_KEY_LAYER1 #define MAGIC_KEY_LAYER1 1 #endif @@ -130,7 +131,11 @@ bool command_proc(uint8_t code); #endif #ifndef MAGIC_KEY_BOOTLOADER -#define MAGIC_KEY_BOOTLOADER PAUSE +#define MAGIC_KEY_BOOTLOADER B +#endif + +#ifndef MAGIC_KEY_BOOTLOADER_ALT +#define MAGIC_KEY_BOOTLOADER_ALT ESC #endif #ifndef MAGIC_KEY_LOCK @@ -141,6 +146,10 @@ bool command_proc(uint8_t code); #define MAGIC_KEY_EEPROM E #endif +#ifndef MAGIC_KEY_EEPROM_CLEAR +#define MAGIC_KEY_EEPROM_CLEAR BSPACE +#endif + #ifndef MAGIC_KEY_NKRO #define MAGIC_KEY_NKRO N #endif @@ -150,7 +159,5 @@ bool command_proc(uint8_t code); #endif -#define XMAGIC_KC(key) KC_##key -#define MAGIC_KC(key) XMAGIC_KC(key) - -#endif \ No newline at end of file +#define XMAGIC_KC(key) KC_ ## key +#define MAGIC_KC(key) XMAGIC_KC(key)