diff options
author | Drashna Jaelre <drashna@live.com> | 2017-11-17 11:59:54 -0800 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2017-11-17 20:48:26 -0500 |
commit | dbd33782f25ce1e0855add21cd92183336670213 (patch) | |
tree | a6b49a4fa70cb605e7f25cf1ddd68e1aa20f9954 /keyboards | |
parent | 1d703a476aa2cea2302c3d672b05b7e252e62c44 (diff) |
Update to drashna keymaps (#4)
* Minor updates to keymaps
* Minor updates to keymaps
Diffstat (limited to 'keyboards')
-rw-r--r-- | keyboards/ergodox_ez/keymaps/drashna/config.h | 1 | ||||
-rw-r--r-- | keyboards/ergodox_ez/keymaps/drashna/keymap.c | 172 | ||||
-rw-r--r-- | keyboards/handwired/woodpad/keymaps/drashna/config.h | 3 | ||||
-rw-r--r-- | keyboards/handwired/woodpad/keymaps/drashna/keymap.c | 168 | ||||
-rw-r--r-- | keyboards/handwired/woodpad/keymaps/drashna/rules.mk | 4 | ||||
-rw-r--r-- | keyboards/orthodox/keymaps/drashna/keymap.c | 12 | ||||
-rw-r--r-- | keyboards/viterbi/keymaps/drashna/config.h | 5 | ||||
-rw-r--r-- | keyboards/viterbi/keymaps/drashna/keymap.c | 128 | ||||
-rw-r--r-- | keyboards/viterbi/keymaps/drashna/rules.mk | 1 |
9 files changed, 60 insertions, 434 deletions
diff --git a/keyboards/ergodox_ez/keymaps/drashna/config.h b/keyboards/ergodox_ez/keymaps/drashna/config.h index 62becc7688..3d138e0721 100644 --- a/keyboards/ergodox_ez/keymaps/drashna/config.h +++ b/keyboards/ergodox_ez/keymaps/drashna/config.h @@ -13,5 +13,6 @@ #define RGBLIGHT_EFFECT_BREATHE_CENTER 1 #endif // RGBLIGHT_ENABLE +#define FORCE_NKRO #endif diff --git a/keyboards/ergodox_ez/keymaps/drashna/keymap.c b/keyboards/ergodox_ez/keymaps/drashna/keymap.c index 1f91612366..08c2447ddb 100644 --- a/keyboards/ergodox_ez/keymaps/drashna/keymap.c +++ b/keyboards/ergodox_ez/keymaps/drashna/keymap.c @@ -32,126 +32,18 @@ bool skip_leds = false; #ifdef TAP_DANCE_ENABLE - -//define diablo macro timer variables -static uint16_t diablo_timer[4]; -static uint8_t diablo_times[] = { 0, 1, 3, 5, 10, 30 }; -static uint8_t diablo_key_time[4]; - -bool check_dtimer(uint8_t dtimer) { - // has the correct number of seconds elapsed (as defined by diablo_times) - return (timer_elapsed(diablo_timer[dtimer]) < (diablo_key_time[dtimer] * 1000)) ? false : true; -}; - -enum { - TD_FLSH = 0, - TD_DIABLO_1, - TD_DIABLO_2, - TD_DIABLO_3, - TD_DIABLO_4 -}; - -// on each tap, light up one led, from right to left -// on the forth tap, turn them off from right to left - -void dance_flsh_each(qk_tap_dance_state_t *state, void *user_data) { - if (!skip_leds) { - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - skip_leds = true; - } - switch (state->count) { - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - case 3: - ergodox_right_led_3_on(); - break; - case 4: - ergodox_right_led_1_off(); - _delay_ms(50); - ergodox_right_led_2_off(); - _delay_ms(50); - ergodox_right_led_3_off(); - - } -} - -// on the fourth tap, set the keyboard on flash state -// and set the underglow to red, because red == bad -void dance_flsh_finished(qk_tap_dance_state_t *state, void *user_data) { - if (state->count >= 4) { -#ifdef RGBLIGHT_ENABLE - rgblight_enable(); - rgblight_mode(1); - rgblight_setrgb(0xff, 0x00, 0x00); +#define KC_D3_1 TD(TD_D3_1) +#define KC_D3_2 TD(TD_D3_2) +#define KC_D3_3 TD(TD_D3_3) +#define KC_D3_4 TD(TD_D3_4) +#else +#define KC_D3_1 KC_1 +#define KC_D3_2 KC_2 +#define KC_D3_3 KC_3 +#define KC_D3_4 KC_4 #endif - reset_tap_dance(state); - reset_keyboard(); - } -} - -// Cycle through the times for the macro, starting at 0, for disabled. -// Max of six values, so don't exceed -void diablo_tapdance_master(qk_tap_dance_state_t *state, void *user_data, uint8_t diablo_key) { - if (state->count >= 7) { - diablo_key_time[diablo_key] = diablo_times[0]; - reset_tap_dance(state); - } - else { - diablo_key_time[diablo_key] = diablo_times[state->count - 1]; - } -} -// Would rather have one function for all of this, but no idea how to do that... -void diablo_tapdance1(qk_tap_dance_state_t *state, void *user_data) { - diablo_tapdance_master(state, user_data, 0); -} - -void diablo_tapdance2(qk_tap_dance_state_t *state, void *user_data) { - diablo_tapdance_master(state, user_data, 1); -} - -void diablo_tapdance3(qk_tap_dance_state_t *state, void *user_data) { - diablo_tapdance_master(state, user_data, 2); -} - -void diablo_tapdance4(qk_tap_dance_state_t *state, void *user_data) { - diablo_tapdance_master(state, user_data, 3); -} - - -// if the flash state didnt happen, then turn off leds, left to right -void dance_flsh_reset(qk_tap_dance_state_t *state, void *user_data) { - _delay_ms(200); - ergodox_right_led_3_off(); - _delay_ms(200); - ergodox_right_led_2_off(); - _delay_ms(200); - ergodox_right_led_1_off(); - _delay_ms(500); - skip_leds = false; -} - -//Tap Dance Definitions -qk_tap_dance_action_t tap_dance_actions[] = { - //Once for Blue, Twice for Green, Thrice for Red, and four to flash - [TD_FLSH] = ACTION_TAP_DANCE_FN_ADVANCED(dance_flsh_each, dance_flsh_finished, dance_flsh_reset), - // tap once to disable, and more to enable timed micros - [TD_DIABLO_1] = ACTION_TAP_DANCE_FN(diablo_tapdance1), - [TD_DIABLO_2] = ACTION_TAP_DANCE_FN(diablo_tapdance2), - [TD_DIABLO_3] = ACTION_TAP_DANCE_FN(diablo_tapdance3), - [TD_DIABLO_4] = ACTION_TAP_DANCE_FN(diablo_tapdance4), - -}; -#endif - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 0: Basic layer * @@ -430,9 +322,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_DIABLO] = LAYOUT_ergodox( KC_ESCAPE, KC_V, KC_D, KC_LALT, KC_NO, KC_NO, KC_NO, - KC_TAB, KC_S, KC_F, KC_I, KC_M, KC_T, KC_TRNS, + KC_TAB, KC_S, KC_I, KC_F, KC_M, KC_T, KC_TRNS, KC_Q, KC_1, KC_2, KC_3, KC_4, KC_G, - KC_LCTL, TD(TD_DIABLO_1), TD(TD_DIABLO_2), TD(TD_DIABLO_3), TD(TD_DIABLO_4), KC_Z, KC_NO, + KC_LCTL, KC_D3_1, KC_D3_2, KC_D3_3, KC_D3_4, KC_Z, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_L, KC_J, KC_F, @@ -499,44 +391,6 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } -#ifdef TAP_DANCE_ENABLE - -// Sends the key press to system, but only if on the Diablo layer -void send_diablo_keystroke(uint8_t diablo_key) { - if (biton32(layer_state) == _DIABLO) { - switch (diablo_key) { - case 0: - SEND_STRING("1"); - break; - case 1: - SEND_STRING("2"); - break; - case 2: - SEND_STRING("3"); - break; - case 3: - SEND_STRING("4"); - break; - } - } -} - -// Checks each of the 4 timers/keys to see if enough time has elapsed -// Runs the "send string" command if enough time has passed, and resets the timer. -void run_diablo_macro_check(void) { - uint8_t dtime; - - for (dtime = 0; dtime < 4; dtime++) { - if (check_dtimer(dtime) && diablo_key_time[dtime]) { - diablo_timer[dtime] = timer_read(); - send_diablo_keystroke(dtime); - } - } - -} - -#endif - void matrix_init_keymap(void) { // Runs boot tasks for keyboard }; @@ -566,9 +420,5 @@ void matrix_scan_keymap(void) { // runs frequently to update info } - // Run Diablo 3 macro checking code. -#ifdef TAP_DANCE_ENABLE - run_diablo_macro_check(); -#endif }; diff --git a/keyboards/handwired/woodpad/keymaps/drashna/config.h b/keyboards/handwired/woodpad/keymaps/drashna/config.h index 780192cf3c..e505aac417 100644 --- a/keyboards/handwired/woodpad/keymaps/drashna/config.h +++ b/keyboards/handwired/woodpad/keymaps/drashna/config.h @@ -24,6 +24,7 @@ #endif // TAP_DANCE_ENABLE +#define B5_AUDIO #ifdef RGBLIGHT_ENABLE @@ -38,6 +39,6 @@ #define RGBLIGHT_EFFECT_BREATHE_CENTER 1 #endif // RGBLIGHT_ENABLE - +#define FORCE_NKRO #endif diff --git a/keyboards/handwired/woodpad/keymaps/drashna/keymap.c b/keyboards/handwired/woodpad/keymaps/drashna/keymap.c index e53c65f105..d0c748c434 100644 --- a/keyboards/handwired/woodpad/keymaps/drashna/keymap.c +++ b/keyboards/handwired/woodpad/keymaps/drashna/keymap.c @@ -24,78 +24,23 @@ // Fillers to make layering more clear #define _______ KC_TRNS #define XXXXXXX KC_NO - - -//define layer change stuff for underglow indicator -bool skip_leds = false; - - #ifdef TAP_DANCE_ENABLE -//define diablo macro timer variables -static uint16_t diablo_timer[4]; -static uint8_t diablo_times[] = { 0, 1, 3, 5, 10, 30 }; -static uint8_t diablo_key_time[4]; - - -bool check_dtimer(uint8_t dtimer) { - // has the correct number of seconds elapsed (as defined by diablo_times) - return (timer_elapsed(diablo_timer[dtimer]) < (diablo_key_time[dtimer] * 1000)) ? false : true; -}; +#define KC_D3_1 TD(TD_D3_1) +#define KC_D3_2 TD(TD_D3_2) +#define KC_D3_3 TD(TD_D3_3) +#define KC_D3_4 TD(TD_D3_4) +#else +#define KC_D3_1 KC_1 +#define KC_D3_2 KC_2 +#define KC_D3_3 KC_3 +#define KC_D3_4 KC_4 #endif +//define layer change stuff for underglow indicator +bool skip_leds = false; -#ifdef TAP_DANCE_ENABLE -enum { - TD_D3_1 = 0, - TD_D3_2, - TD_D3_3, - TD_D3_4 -}; - - -// Cycle through the times for the macro, starting at 0, for disabled. -// Max of six values, so don't exceed -void diablo_tapdance_master(qk_tap_dance_state_t *state, void *user_data, uint8_t diablo_key) { - if (state->count >= 7) { - diablo_key_time[diablo_key] = diablo_times[0]; - reset_tap_dance(state); - } - else { - diablo_key_time[diablo_key] = diablo_times[state->count - 1]; - } -} - - -// Would rather have one function for all of this, but no idea how to do that... -void diablo_tapdance1(qk_tap_dance_state_t *state, void *user_data) { - diablo_tapdance_master(state, user_data, 0); -} - -void diablo_tapdance2(qk_tap_dance_state_t *state, void *user_data) { - diablo_tapdance_master(state, user_data, 1); -} - -void diablo_tapdance3(qk_tap_dance_state_t *state, void *user_data) { - diablo_tapdance_master(state, user_data, 2); -} - -void diablo_tapdance4(qk_tap_dance_state_t *state, void *user_data) { - diablo_tapdance_master(state, user_data, 3); -} - - - -//Tap Dance Definitions -qk_tap_dance_action_t tap_dance_actions[] = { - // tap once to disable, and more to enable timed micros - [TD_D3_1] = ACTION_TAP_DANCE_FN(diablo_tapdance1), - [TD_D3_2] = ACTION_TAP_DANCE_FN(diablo_tapdance2), - [TD_D3_3] = ACTION_TAP_DANCE_FN(diablo_tapdance3), - [TD_D3_4] = ACTION_TAP_DANCE_FN(diablo_tapdance4), -}; -#endif const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_NUMLOCK] = KEYMAP( /* Base */ @@ -112,38 +57,27 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_END, KC_DOWN, KC_PGDN, _______, \ KC_INS, KC_DEL, _______, _______ \ ), -#ifdef TAP_DANCE_ENABLE -[_DIABLO] = KEYMAP( /* Base */ - KC_ESC, _______, _______, _______,\ - KC_S, KC_F, KC_I, KC_M, \ - KC_1, KC_2, KC_3, KC_4, \ - TD(TD_D3_1), TD(TD_D3_2), TD(TD_D3_3), TD(TD_D3_4), \ - _______, KC_DIABLO_CLEAR, KC_Q, SFT_T(KC_SPACE) \ -), -#else [_DIABLO] = KEYMAP( /* Base */ - KC_ESC, _______, _______, _______,\ - KC_S, KC_F, KC_I, KC_M, \ + KC_ESC, _______, XXXXXXX, _______,\ + KC_S, KC_I, KC_F, KC_M, \ KC_1, KC_2, KC_3, KC_4, \ - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - _______, KC_DIABLO_CLEAR, KC_Q, SFT_T(KC_SPACE) \ + KC_D3_1, KC_D3_2, KC_D3_3, KC_D3_4, \ + XXXXXXX, KC_DIABLO_CLEAR, KC_Q, SFT_T(KC_SPACE) \ ), -#endif - [_MACROS] = KEYMAP( /* Base */ - KC_OVERWATCH, _______, _______, XXXXXXX,\ - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - XXXXXXX, XXXXXXX, XXXXXXX, KC_JUSTGAME, \ - KC_SYMM, KC_TORB, XXXXXXX, KC_GOODGAME, \ - KC_SALT, KC_MORESALT, KC_SALTHARD, KC_GLHF \ + KC_OVERWATCH, XXXXXXX, _______, XXXXXXX,\ + KC_JUSTGAME, XXXXXXX, XXXXXXX, KC_C9, \ + XXXXXXX, XXXXXXX, KC_AIM, KC_GGEZ, \ + KC_SYMM, KC_TORB, XXXXXXX, KC_GOODGAME, \ + KC_SALT, KC_MORESALT, KC_SALTHARD, KC_GLHF \ ), [_MEDIA] = KEYMAP( /* Base */ KC_RESET, KC_MUTE, KC_VOLD, KC_VOLU,\ KC_MAKE, _______, RGB_HUI, RGB_HUD, \ KC_MPLY, KC_MSTP, KC_MPRV, KC_MNXT, \ - RGB_TOG, RGB_MOD, RGB_SAI, RGB_VAI, \ - _______, _______, RGB_SAD, RGB_VAD \ + RGB_TOG, RGB_SMOD, RGB_SAI, RGB_VAI, \ + _______, KC_RGB_T, RGB_SAD, RGB_VAD \ ), }; @@ -158,60 +92,7 @@ void numlock_led_off(void) { } -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { -#ifdef TAP_DANCE_ENABLE - case KC_DIABLO_CLEAR: // reset all Diable timers, disabling them - if (record->event.pressed) { - uint8_t dtime; - - for (dtime = 0; dtime < 4; dtime++) { - diablo_key_time[dtime] = diablo_times[0]; - } - } - return false; - break; -#endif - } - return true; -} - -#ifdef TAP_DANCE_ENABLE - -// Sends the key press to system, but only if on the Diablo layer -void send_diablo_keystroke(uint8_t diablo_key) { - if (biton32(layer_state) == _DIABLO) { - switch (diablo_key) { - case 0: - SEND_STRING("1"); - break; - case 1: - SEND_STRING("2"); - break; - case 2: - SEND_STRING("3"); - break; - case 3: - SEND_STRING("4"); - break; - } - } -} - -// Checks each of the 4 timers/keys to see if enough time has elapsed -// Runs the "send string" command if enough time has passed, and resets the timer. -void run_diablo_macro_check(void) { - uint8_t dtime; - - for (dtime = 0; dtime < 4; dtime++) { - if (check_dtimer(dtime) && diablo_key_time[dtime]) { - diablo_timer[dtime] = timer_read(); - send_diablo_keystroke(dtime); - } - } -} -#endif void matrix_init_keymap(void) { // set Numlock LED to output and low DDRF |= (1 << 7); @@ -226,13 +107,10 @@ void matrix_init_keymap(void) { void matrix_scan_keymap(void) { numlock_led_off(); - if ((is_overwatch && biton32(layer_state) == _MACROS) || (biton32(layer_state) == _NAV)) { + if ((is_overwatch && biton32(layer_state) == _MACROS) || (biton32(layer_state) == _NUMLOCK)) { numlock_led_on(); } // Run Diablo 3 macro checking code. -#ifdef TAP_DANCE_ENABLE - run_diablo_macro_check(); -#endif } diff --git a/keyboards/handwired/woodpad/keymaps/drashna/rules.mk b/keyboards/handwired/woodpad/keymaps/drashna/rules.mk index bee3ecf505..ed7d2e7c6d 100644 --- a/keyboards/handwired/woodpad/keymaps/drashna/rules.mk +++ b/keyboards/handwired/woodpad/keymaps/drashna/rules.mk @@ -1,10 +1,10 @@ TAP_DANCE_ENABLE = yes -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -COMMAND_ENABLE = yes # Commands for debug and configuration +COMMAND_ENABLE = no # Commands for debug and configuration RGBLIGHT_ENABLE = yes MIDI_ENABLE = no CONSOLE_ENABLE = no NKRO_ENABLE = yes +MOUSEKEY_ENABLE = no EXTRAFLAGS = -flto diff --git a/keyboards/orthodox/keymaps/drashna/keymap.c b/keyboards/orthodox/keymaps/drashna/keymap.c index ca4e6dc2cd..33e65ac24b 100644 --- a/keyboards/orthodox/keymaps/drashna/keymap.c +++ b/keyboards/orthodox/keymaps/drashna/keymap.c @@ -61,7 +61,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_LOWER] = KEYMAP(\ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, XXXXXXX, KC_F12, _______, XXXXXXX, KC_RCTL, XXXXXXX, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ - TD(TD_FLSH),KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, _______, _______, _______, _______, _______, XXXXXXX, KC_HOME, KC_COMM, KC_DOT, KC_END, _______ \ + _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, _______, _______, _______, _______, _______, XXXXXXX, KC_HOME, KC_COMM, KC_DOT, KC_END, _______ \ ), [_RAISE] = KEYMAP(\ @@ -72,15 +72,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_ADJUST] = KEYMAP(\ KC_MAKE,KC_RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, AU_ON, AU_OFF, AG_NORM, _______, XXXXXXX, _______, _______, XXXXXXX, _______, AG_SWAP, KC_QWERTY, KC_COLEMAK, KC_DVORAK, KC_WORKMAN, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, MAGIC_TOGGLE_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY \ + RGB_SMOD,RGB_HUI, _______, AU_ON, AU_OFF, AG_NORM, _______, XXXXXXX, _______, _______, XXXXXXX, _______, AG_SWAP, KC_QWERTY, KC_COLEMAK, KC_DVORAK, KC_WORKMAN, _______, \ + KC_RGB_T,RGB_HUD, MU_ON, MU_OFF, MU_TOG, MU_MOD, _______, _______, _______, _______, _______, _______, MAGIC_TOGGLE_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY \ ) }; #ifdef FAUXCLICKY_ENABLE -float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_A4, 0.0625); // (_D4, 0.25); -float fauxclicky_released_note[2] = MUSICAL_NOTE(_A4, 0.0625); // (_C4, 0.125); -float fauxclicky_beep_note[2] = MUSICAL_NOTE(_C6, 0.25); // (_C4, 0.25); +float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_A6, 2); // (_D4, 0.25); +float fauxclicky_released_note[2] = MUSICAL_NOTE(_A6, 2); // (_C4, 0.125); +float fauxclicky_beep_note[2] = MUSICAL_NOTE(_C6, 2); // (_C4, 0.25); #endif diff --git a/keyboards/viterbi/keymaps/drashna/config.h b/keyboards/viterbi/keymaps/drashna/config.h index 13c17b7bab..8ac492a8a2 100644 --- a/keyboards/viterbi/keymaps/drashna/config.h +++ b/keyboards/viterbi/keymaps/drashna/config.h @@ -42,4 +42,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define RGBLIGHT_EFFECT_BREATHE_CENTER 1 +#ifdef AUDIO_ENABLE +#define C6_AUDIO +#endif + + #endif diff --git a/keyboards/viterbi/keymaps/drashna/keymap.c b/keyboards/viterbi/keymaps/drashna/keymap.c index 48a146958e..89621fa200 100644 --- a/keyboards/viterbi/keymaps/drashna/keymap.c +++ b/keyboards/viterbi/keymaps/drashna/keymap.c @@ -21,73 +21,9 @@ extern keymap_config_t keymap_config; #define MEDIA TG(_MEDIA) #define COVECUBE TG(_COVECUBE) - - - -#ifdef TAP_DANCE_ENABLE -//define diablo macro timer variables -static uint16_t diablo_timer[4]; -static uint8_t diablo_times[] = { 0, 1, 3, 5, 10, 30 }; -static uint8_t diablo_key_time[4]; - - -bool check_dtimer(uint8_t dtimer) { - // has the correct number of seconds elapsed (as defined by diablo_times) - return (timer_elapsed(diablo_timer[dtimer]) < (diablo_key_time[dtimer] * 1000)) ? false : true; -}; - - -enum { - TD_D3_1 = 0, - TD_D3_2, - TD_D3_3, - TD_D3_4 -}; - - -// Cycle through the times for the macro, starting at 0, for disabled. -// Max of six values, so don't exceed -void diablo_tapdance_master(qk_tap_dance_state_t *state, void *user_data, uint8_t diablo_key) { - if (state->count >= 7) { - diablo_key_time[diablo_key] = diablo_times[0]; - reset_tap_dance(state); - } - else { - diablo_key_time[diablo_key] = diablo_times[state->count - 1]; - } -} - - -// Would rather have one function for all of this, but no idea how to do that... -void diablo_tapdance1(qk_tap_dance_state_t *state, void *user_data) { - diablo_tapdance_master(state, user_data, 0); -} - -void diablo_tapdance2(qk_tap_dance_state_t *state, void *user_data) { - diablo_tapdance_master(state, user_data, 1); -} - -void diablo_tapdance3(qk_tap_dance_state_t *state, void *user_data) { - diablo_tapdance_master(state, user_data, 2); -} - -void diablo_tapdance4(qk_tap_dance_state_t *state, void *user_data) { - diablo_tapdance_master(state, user_data, 3); -} - - - -//Tap Dance Definitions -qk_tap_dance_action_t tap_dance_actions[] = { - // tap once to disable, and more to enable timed micros - [TD_D3_1] = ACTION_TAP_DANCE_FN(diablo_tapdance1), - [TD_D3_2] = ACTION_TAP_DANCE_FN(diablo_tapdance2), - [TD_D3_3] = ACTION_TAP_DANCE_FN(diablo_tapdance3), - [TD_D3_4] = ACTION_TAP_DANCE_FN(diablo_tapdance4), - +enum more_custom_keycodes { + KC_KP_00 = NEW_SAFE_RANGE }; -#endif - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -95,8 +31,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LMACRO, DIABLO, GAMEPAD, KC_NLCK, KC_SLCK, KC_COLN, KC_PSLS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ MEDIA, KC_CALC, COVECUBE, KC_P7, KC_P8, KC_P9, KC_PAST, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ KC_HOME, KC_DEL, KC_PGUP, KC_P4, KC_P5, KC_P6, KC_PMNS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - KC_END, KC_UP, KC_PGDN, KC_P1, KC_P2, KC_P3, KC_PPLS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - KC_LEFT, KC_DOWN, K C_RGHT, KC_P0, KC_KP_00,KC_PDOT, KC_PENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ + KC_END, KC_UP, KC_PGDN, KC_P1, KC_P2, KC_P3, KC_PPLS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_KP_00,KC_PDOT, KC_PENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ ), [_DIABLO] = KEYMAP( @@ -143,68 +79,22 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; - bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { switch (keycode) { -#ifdef TAP_DANCE_ENABLE - case KC_DIABLO_CLEAR: // reset all Diable timers, disabling them + case KC_KP_00: if (record->event.pressed) { - uint8_t dtime; - - for (dtime = 0; dtime < 4; dtime++) { - diablo_key_time[dtime] = diablo_times[0]; - } + register_code(KC_KP_0); + unregister_code(KC_KP_0); + register_code(KC_KP_0); + unregister_code(KC_KP_0); } return false; break; -#endif } return true; } -#ifdef TAP_DANCE_ENABLE - -// Sends the key press to system, but only if on the Diablo layer -void send_diablo_keystroke(uint8_t diablo_key) { - if (biton32(layer_state) == _DIABLO) { - switch (diablo_key) { - case 0: - SEND_STRING("1"); - break; - case 1: - SEND_STRING("2"); - break; - case 2: - SEND_STRING("3"); - break; - case 3: - SEND_STRING("4"); - break; - } - } -} - -// Checks each of the 4 timers/keys to see if enough time has elapsed -// Runs the "send string" command if enough time has passed, and resets the timer. -void run_diablo_macro_check(void) { - uint8_t dtime; - - for (dtime = 0; dtime < 4; dtime++) { - if (check_dtimer(dtime) && diablo_key_time[dtime]) { - diablo_timer[dtime] = timer_read(); - send_diablo_keystroke(dtime); - } - } -} -#endif -void matrix_scan_keymap(void) { // runs frequently to update info -#ifdef TAP_DANCE_ENABLE - // Run Diablo 3 macro checking code. - run_diablo_macro_check(); -#endif -}; - diff --git a/keyboards/viterbi/keymaps/drashna/rules.mk b/keyboards/viterbi/keymaps/drashna/rules.mk index dd5747f1d0..34b1903709 100644 --- a/keyboards/viterbi/keymaps/drashna/rules.mk +++ b/keyboards/viterbi/keymaps/drashna/rules.mk @@ -1,4 +1,5 @@ CONSOLE_ENABLE = no +COMMAND_ENABLE = no # Commands for debug and configuration TAP_DANCE_ENABLE = yes RGBLIGHT_ENABLE = yes MOUSEKEY_ENABLE = no |