tap hold fixes

This commit is contained in:
Norbert Csibra 2024-11-02 13:34:26 +01:00
commit 568e2f86ad
6 changed files with 11 additions and 74 deletions

View file

@ -1,20 +1,5 @@
#include "ncsibra.h"
// Add reconfigurable functions here, for keymap customization
// This allows for a global, userspace functions, and continued
// customization of the keymap. Use _keymap instead of _user
// functions in the keymaps
__attribute__ ((weak))
void matrix_init_keymap(void) {}
__attribute__ ((weak))
void matrix_scan_keymap(void) {}
__attribute__ ((weak))
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
return true;
}
// Tap hold keys
static taphold_t th_events[] = {
{ .is_pressed = false, .is_double = false, .timer = 0, .kc_tap = KC_ESC, .kc_hold = KC_F11 },
@ -40,8 +25,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return false;
}
return process_record_user_taphold(keycode, record)
&& process_record_keymap(keycode, record);
return process_record_user_taphold(keycode, record);
};
static uint16_t prev_th_key = KC_NO;
@ -94,4 +78,9 @@ void matrix_scan_tap_hold(taphold_state state) {
th_event->is_pressed = false;
}
}
}
}
void matrix_scan_user(void) {
matrix_scan_tap_hold(HELD);
}

View file

@ -79,7 +79,7 @@ enum keycodes {
_______, _______, _______, _______, _______, _______, _______, KC_LCTL, KC_LCTL, _______, _______, XXXXXXX
#define RAISE_LAYER \
QK_RBT, XXXXXXX, XXXXXXX, XXXXXXX, DF(_QWERTY), XXXXXXX, XXXXXXX, DF(_COLEMAK), XXXXXXX, XXXXXXX, XXXXXXX, TO(_WOW), \
QK_BOOT, XXXXXXX, XXXXXXX, XXXXXXX, DF(_QWERTY), XXXXXXX, XXXXXXX, DF(_COLEMAK), XXXXXXX, XXXXXXX, XXXXXXX, TO(_WOW), \
DB_TOGG, XXXXXXX, XXXXXXX, KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_END, XXXXXXX, KC_DEL, \
_______, KC_LGUI, KC_LALT, XXXXXXX, KC_LCTL, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RIGHT, XXXXXXX, _______, \
KC_CAPS, _______, _______, _______, _______, _______, XXXXXXX, KC_PGUP, XXXXXXX, KC_PGDN, XXXXXXX, _______, \
@ -99,7 +99,7 @@ enum keycodes {
KC_TAB, KC_H, KC_Q, KC_W, KC_E, KC_R, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT, \
KC_TAB, KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, \
KC_LSFT, KC_Z, KC_X, KC_N, KC_C, KC_V, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \
KC_M, KC_Y, KC_LALT, KC_LCTL, KC_SPC, KC_P, KC_BSPC, KC_DEL, KC_DEL, KC_LGUI, KC_PSCREEN, TO(_COLEMAK)
KC_M, KC_Y, KC_LALT, KC_LCTL, KC_SPC, KC_P, KC_BSPC, KC_DEL, KC_DEL, KC_LGUI, KC_PSCR, TO(_COLEMAK)
// tap-hold settings
#define TH_DELAY 300

View file

@ -1,5 +1,6 @@
SRC += ncsibra.c
CONSOLE_ENABLE = yes
NKRO_ENABLE = yes
LEADER_ENABLE = no
COMBO_ENABLE = no