stasmarkin / sm_td

SM Tap Dance user library for QMK
GNU General Public License v3.0
166 stars 8 forks source link

A and F keys are losing connection #22

Open chuan2984 opened 2 months ago

chuan2984 commented 2 months ago

I recently began using this modification and have been gradually adjusting its settings. However, I've encountered an issue on three separate occasions: the sporadic loss of functionality in my 'A' and/or 'F' keys. Prior to this, I was using the original Homerow modification without experiencing any similar problems.

The issue manifests as a complete failure of the affected keys to register input, as if they've lost connection. This persists until I either reset or reconnect my keyboard.

I haven't yet conducted extensive troubleshooting, but I'm curious if other users have experienced similar issues. Any insights or suggestions would be greatly appreciated.

Heres my keymap.c

enum custom_keycodes {
    something = SAFE_RANGE,
    SMTD_KEYCODES_BEGIN,
    CKC_A, // reads as C(ustom) + KC_A, but you may give any name here
    CKC_S,
    CKC_D,
    CKC_F,
    CKC_J,
    CKC_K,
    CKC_L,
    CKC_SCLN,
    SMTD_KEYCODES_END,
};

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
    if (!process_smtd(keycode, record)) {
        return false;
    }
  // my own switch
};

void on_smtd_action(uint16_t keycode, smtd_action action, uint8_t tap_count) {
    switch (keycode) {
        SMTD_MT(CKC_A, KC_A, KC_LEFT_GUI)
        SMTD_MT(CKC_S, KC_S, KC_LEFT_ALT)
        SMTD_MT(CKC_D, KC_D, KC_LSFT)
        SMTD_MT(CKC_F, KC_F, KC_LEFT_CTRL)
        SMTD_MT(CKC_J, KC_J, KC_RIGHT_CTRL)
        SMTD_MT(CKC_K, KC_K, KC_RIGHT_SHIFT)
        SMTD_MT(CKC_L, KC_L, KC_LEFT_ALT)
        SMTD_MT(CKC_SCLN, KC_SCLN, KC_RIGHT_GUI)
    }
}

// I then use these 8 keys in my actual keymap definition
alxzh commented 2 months ago

I recently ran into the same issue, for me the keys that lost functionality where random but on the home row. It looks like this happens when there were some weird combination of home row buttons pressed at the same time which locks something up. The easiest solution was to reconnect the keyboard.

My config is pretty similar to the one above:

 enum custom_keycodes {
  RGB_SLD = SAFE_RANGE,
  MAC_MISSION_CONTROL,
  MAC_SPOTLIGHT,
  MAC_SCREEN_SHOT,
  MAC_DND,
  MAC_LOCK,
  MACRO_VIM_Q,
  MACRO_VIM_W,
  MACRO_FARROW,
  MACRO_ARROW,
  SMTD_KEYCODES_BEGIN,
  CKC_A,
  CKC_R,
  CKC_S,
  CKC_T,
  CKC_N,
  CKC_E,
  CKC_I,
  CKC_O,
  SMTD_KEYCODES_END,
};

void on_smtd_action(uint16_t keycode, smtd_action action, uint8_t tap_count) {
    switch (keycode) {
        SMTD_MT(CKC_A, KC_A, KC_LEFT_GUI)
        SMTD_MT(CKC_R, KC_R, KC_LEFT_CTRL)
        SMTD_MT(CKC_S, KC_S, KC_LEFT_ALT)
        SMTD_MT(CKC_T, KC_T, KC_LSFT)
        SMTD_MT(CKC_N, KC_N, KC_RSFT)
        SMTD_MT(CKC_E, KC_E, KC_RIGHT_ALT)
        SMTD_MT(CKC_I, KC_I, KC_RIGHT_CTRL)
        SMTD_MT(CKC_O, KC_O, KC_RIGHT_GUI)
    }
}

uint32_t get_smtd_timeout(uint16_t keycode, smtd_timeout timeout) {
    switch (keycode) {
        case CKC_A:
        case CKC_O:
        case CKC_T:
        case CKC_S:
        case CKC_R:
        case CKC_N:
        case CKC_E:
        case CKC_I:
            if (timeout == SMTD_TIMEOUT_TAP) return 200;
            if (timeout == SMTD_TIMEOUT_FOLLOWING_TAP) return 200;
            if (timeout == SMTD_TIMEOUT_RELEASE) return 30;
    }

    return get_smtd_timeout_default(timeout);
}
stasmarkin commented 2 months ago

Sorry for the wait, had a busy week. I know about this problem, hopefully I will fix it in the next version. Unfortunately there is nothing you can do about it right now.

chuan2984 commented 2 months ago

Sorry for the wait, had a busy week. I know about this problem, hopefully I will fix it in the next version. Unfortunately there is nothing you can do about it right now.

thank you very much! great work!