X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=quantum%2Fkeymap.h;h=98ddfd0c533e4bda998e879e271fb1f41e141999;hb=91d2b64850acb94177eca0c0c03380282c1b890b;hp=43efab7f3fbe6dabf348973e6b605d603af8f7d3;hpb=76076db72545bbb649f11394a12721f61579527f;p=qmk_firmware.git diff --git a/quantum/keymap.h b/quantum/keymap.h index 43efab7f3..98ddfd0c5 100644 --- a/quantum/keymap.h +++ b/quantum/keymap.h @@ -21,7 +21,9 @@ along with this program. If not, see . #include #include #include "action.h" +#if defined(__AVR__) #include +#endif #include "keycode.h" #include "action_macro.h" #include "report.h" @@ -30,12 +32,15 @@ along with this program. If not, see . #include "debug.h" #include "keycode_config.h" +// ChibiOS uses RESET in its FlagStatus enumeration +// Therefore define it as QK_RESET here, to avoid name collision +#if defined(PROTOCOL_CHIBIOS) +#define RESET QK_RESET +#endif + /* translates key to keycode */ uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key); -/* translates Fn keycode to action */ -action_t keymap_fn_to_action(uint16_t keycode); - extern const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; extern const uint16_t fn_actions[]; @@ -77,6 +82,8 @@ enum quantum_keycodes { #endif QK_MOD_TAP = 0x6000, QK_MOD_TAP_MAX = 0x6FFF, + QK_TAP_DANCE = 0x7100, + QK_TAP_DANCE_MAX = 0x71FF, #ifdef UNICODE_ENABLE QK_UNICODE = 0x8000, QK_UNICODE_MAX = 0xFFFF, @@ -104,6 +111,7 @@ enum quantum_keycodes { MAGIC_UNSWAP_BACKSLASH_BACKSPACE, MAGIC_UNHOST_NKRO, MAGIC_UNSWAP_ALT_GUI, + MAGIC_TOGGLE_NKRO, // Leader key #ifndef DISABLE_LEADER @@ -125,8 +133,8 @@ enum quantum_keycodes { MUV_DE, // Midi mode on/off - MI_ON, - MI_OFF, + MIDI_ON, + MIDI_OFF, // Backlight functionality BL_0, @@ -150,11 +158,24 @@ enum quantum_keycodes { BL_TOGG, BL_STEP, + // RGB functionality + RGB_TOG, + RGB_MOD, + RGB_HUI, + RGB_HUD, + RGB_SAI, + RGB_SAD, + RGB_VAI, + RGB_VAD, + // Left shift, open paren KC_LSPO, // Right shift, close paren - KC_RSPC + KC_RSPC, + + // always leave at the end + SAFE_RANGE }; // Ability to use mods in layouts @@ -266,6 +287,9 @@ enum quantum_keycodes { #define BL_ON BL_9 #define BL_OFF BL_0 +#define MI_ON MIDI_ON +#define MI_OFF MIDI_OFF + // GOTO layer - 16 layers max // when: // ON_PRESS = 1 @@ -286,7 +310,7 @@ enum quantum_keycodes { #define OSL(layer) (layer | QK_ONE_SHOT_LAYER) // One-shot mod -#define OSM(layer) (layer | QK_ONE_SHOT_MOD) +#define OSM(mod) (mod | QK_ONE_SHOT_MOD) // M-od, T-ap - 256 keycode max #define MT(mod, kc) (kc | QK_MOD_TAP | ((mod & 0xF) << 8)) @@ -294,10 +318,10 @@ enum quantum_keycodes { #define SFT_T(kc) MT(MOD_LSFT, kc) #define ALT_T(kc) MT(MOD_LALT, kc) #define GUI_T(kc) MT(MOD_LGUI, kc) -#define C_S_T(kc) MT(MOD_LCTL | MOD_LSFT, kc) // Control + Shift e.g. for gnome-terminal -#define MEH_T(kc) MT(MOD_LCTL | MOD_LSFT | MOD_LALT, 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(MOD_LCTL | MOD_LALT | MOD_LGUI, kc) // Left control alt and gui -#define ALL_T(kc) MT(MOD_LCTL | MOD_LSFT | MOD_LALT | MOD_LGUI, kc) // see http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/ +#define C_S_T(kc) MT((MOD_LCTL | MOD_LSFT), kc) // Control + Shift e.g. for gnome-terminal +#define MEH_T(kc) MT((MOD_LCTL | MOD_LSFT | MOD_LALT), 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((MOD_LCTL | MOD_LALT | MOD_LGUI), kc) // Left control alt and gui +#define ALL_T(kc) MT((MOD_LCTL | MOD_LSFT | MOD_LALT | MOD_LGUI), 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 #define KC_HYPR HYPR(KC_NO)