Added per case tapping term, updated FF-nikchi keymap.
This commit is contained in:
parent
17a378715e
commit
e695b5a33b
4 changed files with 15 additions and 9 deletions
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include "../../config.h"
|
#include "../../config.h"
|
||||||
|
|
||||||
#define TAPPING_TERM 800
|
#define TAPPING_TERM 200
|
||||||
#define LEADER_TIMEOUT 400
|
#define LEADER_TIMEOUT 400
|
||||||
|
|
||||||
#define DISABLE_SPACE_CADET_ROLLOVER
|
#define DISABLE_SPACE_CADET_ROLLOVER
|
||||||
|
|
|
@ -77,10 +77,10 @@ enum quick {
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||||
// Tap once for CTRL, twice for Caps Lock
|
// Tap once for CTRL, twice for Caps Lock
|
||||||
[TD_CTCPS] = ACTION_TAP_DANCE_DOUBLE(KC_LCTL, KC_CAPS),
|
[TD_CTCPS] = ACTION_TAP_DANCE_DOUBLE(KC_LCTL, KC_CAPS),
|
||||||
[EMOJIS] = ACTION_TAP_DANCE_FN_ADVANCED(cycleEmojis, NULL, NULL),
|
[EMOJIS] = ACTION_TAP_DANCE_FN_ADVANCED(cycleEmojis, NULL, NULL, 800),
|
||||||
[ANIMAL] = ACTION_TAP_DANCE_FN_ADVANCED(cycleAnimals, NULL, NULL),
|
[ANIMAL] = ACTION_TAP_DANCE_FN_ADVANCED(cycleAnimals, NULL, NULL, 800),
|
||||||
[HAND] = ACTION_TAP_DANCE_FN_ADVANCED(cycleHands, NULL, NULL),
|
[HAND] = ACTION_TAP_DANCE_FN_ADVANCED(cycleHands, NULL, NULL, 800),
|
||||||
[MEMES] = ACTION_TAP_DANCE_FN_ADVANCED(cycleMemes, NULL, NULL)
|
[MEMES] = ACTION_TAP_DANCE_FN_ADVANCED(cycleMemes, NULL, NULL, 800)
|
||||||
// Other declarations would go here, separated by commas, if you have them
|
// Other declarations would go here, separated by commas, if you have them
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -130,11 +130,17 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) {
|
||||||
void matrix_scan_tap_dance () {
|
void matrix_scan_tap_dance () {
|
||||||
if (highest_td == -1)
|
if (highest_td == -1)
|
||||||
return;
|
return;
|
||||||
|
int tap_user_defined;
|
||||||
|
|
||||||
for (int i = 0; i <= highest_td; i++) {
|
for (int i = 0; i <= highest_td; i++) {
|
||||||
qk_tap_dance_action_t *action = &tap_dance_actions[i];
|
qk_tap_dance_action_t *action = &tap_dance_actions[i];
|
||||||
|
if(action->user_data != NULL ) {
|
||||||
if (action->state.count && timer_elapsed (action->state.timer) > TAPPING_TERM) {
|
tap_user_defined = (int)action->user_data;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
tap_user_defined = TAPPING_TERM;
|
||||||
|
}
|
||||||
|
if (action->state.count && timer_elapsed (action->state.timer) > tap_user_defined) {
|
||||||
process_tap_dance_action_on_dance_finished (action);
|
process_tap_dance_action_on_dance_finished (action);
|
||||||
reset_tap_dance (&action->state);
|
reset_tap_dance (&action->state);
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,9 +63,9 @@ typedef struct
|
||||||
.user_data = NULL, \
|
.user_data = NULL, \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define ACTION_TAP_DANCE_FN_ADVANCED(user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset) { \
|
#define ACTION_TAP_DANCE_FN_ADVANCED(user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset, tap_specific_tapping_term) { \
|
||||||
.fn = { user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset }, \
|
.fn = { user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset }, \
|
||||||
.user_data = NULL, \
|
.user_data = (void *)(tap_specific_tapping_term), \
|
||||||
}
|
}
|
||||||
|
|
||||||
extern qk_tap_dance_action_t tap_dance_actions[];
|
extern qk_tap_dance_action_t tap_dance_actions[];
|
||||||
|
|
Loading…
Reference in a new issue