diff options
| -rw-r--r-- | keyboards/satan/keymaps/smt/Makefile | 3 | ||||
| -rw-r--r-- | keyboards/satan/keymaps/smt/keymap.c | 43 |
2 files changed, 12 insertions, 34 deletions
diff --git a/keyboards/satan/keymaps/smt/Makefile b/keyboards/satan/keymaps/smt/Makefile index 2a7ff2779..afcd025e1 100644 --- a/keyboards/satan/keymaps/smt/Makefile +++ b/keyboards/satan/keymaps/smt/Makefile | |||
| @@ -8,13 +8,14 @@ EXTRAKEY_ENABLE = yes # Audio control and System control(+450) | |||
| 8 | CONSOLE_ENABLE = no # Console for debug(+400) | 8 | CONSOLE_ENABLE = no # Console for debug(+400) |
| 9 | COMMAND_ENABLE = yes # Commands for debug and configuration | 9 | COMMAND_ENABLE = yes # Commands for debug and configuration |
| 10 | NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | 10 | NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work |
| 11 | BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality | 11 | BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality |
| 12 | MIDI_ENABLE = no # MIDI controls | 12 | MIDI_ENABLE = no # MIDI controls |
| 13 | AUDIO_ENABLE = no # Audio output on port C6 | 13 | AUDIO_ENABLE = no # Audio output on port C6 |
| 14 | UNICODE_ENABLE = no # Unicode | 14 | UNICODE_ENABLE = no # Unicode |
| 15 | BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID | 15 | BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID |
| 16 | RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. | 16 | RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. |
| 17 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | 17 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend |
| 18 | TAP_DANCE_ENABLE = yes # Enable tap dance | ||
| 18 | 19 | ||
| 19 | ifndef QUANTUM_DIR | 20 | ifndef QUANTUM_DIR |
| 20 | include ../../../../Makefile | 21 | include ../../../../Makefile |
diff --git a/keyboards/satan/keymaps/smt/keymap.c b/keyboards/satan/keymaps/smt/keymap.c index 4ac016f21..7f9e9c2d5 100644 --- a/keyboards/satan/keymaps/smt/keymap.c +++ b/keyboards/satan/keymaps/smt/keymap.c | |||
| @@ -20,6 +20,10 @@ enum planck_keycodes { | |||
| 20 | DVORAK | 20 | DVORAK |
| 21 | }; | 21 | }; |
| 22 | 22 | ||
| 23 | enum { | ||
| 24 | TD_SHIFT_RAISE = 0 | ||
| 25 | }; | ||
| 26 | |||
| 23 | #define _______ KC_TRNS | 27 | #define _______ KC_TRNS |
| 24 | #define XXXXXXX KC_NO | 28 | #define XXXXXXX KC_NO |
| 25 | 29 | ||
| @@ -28,7 +32,7 @@ enum planck_keycodes { | |||
| 28 | #define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl | 32 | #define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl |
| 29 | #define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Shift+Alt) | 33 | #define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Shift+Alt) |
| 30 | #define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift | 34 | #define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift |
| 31 | #define SFT_RSE TD(KC_LSFT, OS(_RAISE)) // Double-tap for RAISE one-shot, otherwise Left Shift | 35 | #define SFT_RSE TD(TD_SHIFT_RAISE) // Double-tap for RAISE one-shot, otherwise Left Shift |
| 32 | 36 | ||
| 33 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 37 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
| 34 | /* Keymap _QWERTY: (Base Layer) Default Layer | 38 | /* Keymap _QWERTY: (Base Layer) Default Layer |
| @@ -170,36 +174,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 170 | return true; | 174 | return true; |
| 171 | } | 175 | } |
| 172 | 176 | ||
| 173 | enum function_id { | 177 | // Tap Dance Definitions |
| 174 | SHIFT_ESC, | 178 | qk_tap_dance_action_t tap_dance_actions[] = { |
| 179 | // Tap/hold once for Shift, tap twice for raise layer | ||
| 180 | [TD_SHIFT_RAISE] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, _RAISE) | ||
| 181 | // Other declarations would go here, separated by commas, if you have them | ||
| 175 | }; | 182 | }; |
| 176 | |||
| 177 | const uint16_t PROGMEM fn_actions[] = { | ||
| 178 | [0] = ACTION_FUNCTION(SHIFT_ESC), | ||
| 179 | }; | ||
| 180 | |||
| 181 | void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { | ||
| 182 | static uint8_t shift_esc_shift_mask; | ||
| 183 | switch (id) { | ||
| 184 | case SHIFT_ESC: | ||
| 185 | shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; | ||
| 186 | if (record->event.pressed) { | ||
| 187 | if (shift_esc_shift_mask) { | ||
| 188 | add_key(KC_GRV); | ||
| 189 | send_keyboard_report(); | ||
| 190 | } else { | ||
| 191 | add_key(KC_ESC); | ||
| 192 | send_keyboard_report(); | ||
| 193 | } | ||
| 194 | } else { | ||
| 195 | if (shift_esc_shift_mask) { | ||
| 196 | del_key(KC_GRV); | ||
| 197 | send_keyboard_report(); | ||
| 198 | } else { | ||
| 199 | del_key(KC_ESC); | ||
| 200 | send_keyboard_report(); | ||
| 201 | } | ||
| 202 | } | ||
| 203 | break; | ||
| 204 | } | ||
| 205 | } | ||
