ridingqwerty: userspace update (#8076)
* Userspace overhaul * Remove testing directory * Minorca keymap tweaks
This commit is contained in:
parent
50554ca270
commit
964ed17716
18 changed files with 2388 additions and 101 deletions
33
users/ridingqwerty/tapdances.c
Normal file
33
users/ridingqwerty/tapdances.c
Normal file
|
@ -0,0 +1,33 @@
|
|||
#include "ridingqwerty.h"
|
||||
#include "tapdances.h"
|
||||
|
||||
void braces_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||
if ((state->count == 1) || (state->count == 3)) {
|
||||
register_code(KC_LSFT);
|
||||
}
|
||||
}
|
||||
|
||||
void braces_reset (qk_tap_dance_state_t *state, void *user_data) {
|
||||
// two or three taps for "[]"/"{}"
|
||||
if ((state->count == 2) || (state->count == 3)) {
|
||||
tap_code(KC_LBRC);
|
||||
tap_code(KC_RBRC);
|
||||
}
|
||||
// one tap for "()"
|
||||
else if (state->count == 1) {
|
||||
tap_code(KC_9);
|
||||
tap_code(KC_0);
|
||||
}
|
||||
|
||||
// unregister the shift unconditionally
|
||||
unregister_code(KC_LSFT);
|
||||
|
||||
// move back one space, inside the braces
|
||||
if (state->count <= 3) {
|
||||
tap_code(KC_LEFT);
|
||||
}
|
||||
}
|
||||
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
[TD_BRACES] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, braces_finished, braces_reset)
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue