X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=quantum%2Fkeymap_common.h;h=0ede0296b98fbe013f71f37595d249815409bb0c;hb=8ec1d41a28d5223a147218bfb7fefd933b906d22;hp=4a877d2a701f45c91ae7ea5b418091600c3ec578;hpb=1689f275ace6258f43042d78430959d8877caea1;p=qmk_firmware.git diff --git a/quantum/keymap_common.h b/quantum/keymap_common.h index 4a877d2a7..0ede0296b 100644 --- a/quantum/keymap_common.h +++ b/quantum/keymap_common.h @@ -30,7 +30,6 @@ along with this program. If not, see . // #include "print.h" #include "debug.h" -#ifdef BOOTMAGIC_ENABLE /* NOTE: Not portable. Bit field order depends on implementation */ typedef union { uint16_t raw; @@ -45,8 +44,6 @@ typedef union { bool nkro:1; }; } keymap_config_t; -keymap_config_t keymap_config; -#endif /* translates key to keycode */ @@ -168,6 +165,30 @@ extern const uint16_t fn_actions[]; #define RESET 0x5000 #define DEBUG 0x5001 +// MAGIC keycodes +#define MAGIC_SWAP_CONTROL_CAPSLOCK 0x5002 +#define MAGIC_UNSWAP_CONTROL_CAPSLOCK 0x5003 +#define MAGIC_CAPSLOCK_TO_CONTROL 0x5004 +#define MAGIC_UNCAPSLOCK_TO_CONTROL 0x5005 +#define MAGIC_SWAP_LALT_LGUI 0x5006 +#define MAGIC_UNSWAP_LALT_LGUI 0x5007 +#define MAGIC_SWAP_RALT_RGUI 0x5008 +#define MAGIC_UNSWAP_RALT_RGUI 0x5009 +#define MAGIC_NO_GUI 0x500a +#define MAGIC_UNNO_GUI 0x500b +#define MAGIC_SWAP_GRAVE_ESC 0x500c +#define MAGIC_UNSWAP_GRAVE_ESC 0x500d +#define MAGIC_SWAP_BACKSLASH_BACKSPACE 0x500e +#define MAGIC_UNSWAP_BACKSLASH_BACKSPACE 0x500f +#define MAGIC_HOST_NKRO 0x5010 +#define MAGIC_UNHOST_NKRO 0x5011 +#define MAGIC_SWAP_ALT_GUI 0x5012 +#define MAGIC_UNSWAP_ALT_GUI 0x5013 + +#define AG_SWAP MAGIC_SWAP_ALT_GUI +#define AG_NORM MAGIC_UNSWAP_ALT_GUI + + // GOTO layer - 16 layers max // when: // ON_PRESS = 1 @@ -192,7 +213,7 @@ extern const uint16_t fn_actions[]; #define GUI_T(kc) MT(0x8, kc) #define C_S_T(kc) MT(0x3, kc) // Control + Shift e.g. for gnome-terminal #define MEH_T(kc) MT(0x7, kc) // Meh is a less hyper version of the Hyper key -- doesn't include Win or Cmd, so just alt+shift+ctrl -#define LCAG_T(kc) MT(0xD, kc) // Left control alt and gui +#define LCAG_T(kc) MT(0xD, kc) // Left control alt and gui #define ALL_T(kc) MT(0xF, kc) // see http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/ // Dedicated keycode versions for Hyper and Meh, if you want to use them as standalone keys rather than mod-tap @@ -208,5 +229,10 @@ extern const uint16_t fn_actions[]; #define UNICODE(n) (n | 0x8000) #define UC(n) UNICODE(n) +// For tri-layer +void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3); +#define IS_LAYER_ON(layer) (layer_state & (1UL << (layer))) +#define IS_LAYER_OFF(layer) (~layer_state & (1UL << (layer))) + #endif