stasmarkin / sm_td

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

Migration from Miryoku #14

Open azzamsa opened 1 week ago

azzamsa commented 1 week ago

Hi 👋🏽

I've been a long-time Miryoku user and recently tried migrating to my own keymap using this library. However, I’ve been experiencing a lot of misfires, even though I’m a veteran with HMR after years of using Miryoku.

Do you have any tips to make the transition smoother?

I’ve attached my keymap below:


I’m also using sm_td with my new XDA keycaps and linear switches for the first time, and I suspect they might be contributing to the misfires. I never used both XDA and linear switches before before.

So, I tried on my daily keyboard, but I get this issue. #15

azzamsa commented 1 week ago

I don't add any config but sm_td related. Should I add something similar?

azzamsa commented 1 week ago

I tried to add these lines, taken from miryoku config.h, but it doesn't fix the misfire.

#define TAPPING_TERM 200
// Enable rapid switch from tap to hold, disables double tap hold auto-repeat.
#define QUICK_TAP_TERM 0

// Auto Shift
#define NO_AUTO_SHIFT_ALPHA
#define AUTO_SHIFT_TIMEOUT TAPPING_TERM
#define AUTO_SHIFT_NO_SETUP

Only after adding these lines, I can now type comfortably.

uint32_t get_smtd_timeout(uint16_t keycode, smtd_timeout timeout) {
    switch (keycode) {
        // left side
        case CKC_A:
            if (timeout == SMTD_TIMEOUT_RELEASE) return 30;
            break;
        case CKC_R:
            if (timeout == SMTD_TIMEOUT_RELEASE) return 30;
            break;
        case CKC_S:
            if (timeout == SMTD_TIMEOUT_RELEASE) return 30;
            break;
        case CKC_T:
            if (timeout == SMTD_TIMEOUT_RELEASE) return 30;
            break;
        case CKC_ESC:
            if (timeout == SMTD_TIMEOUT_RELEASE) return 30;
            break;
        case CKC_SPC:
            if (timeout == SMTD_TIMEOUT_RELEASE) return 30;
            break;
        case CKC_TAB:
            if (timeout == SMTD_TIMEOUT_RELEASE) return 30;
            break;

        // right side
        case CKC_N:
            if (timeout == SMTD_TIMEOUT_RELEASE) return 30;
            break;
        case CKC_E:
            if (timeout == SMTD_TIMEOUT_RELEASE) return 30;
            break;
        case CKC_I:
            if (timeout == SMTD_TIMEOUT_RELEASE) return 30;
            break;
        case CKC_O:
            if (timeout == SMTD_TIMEOUT_RELEASE) return 30;
            break;
        case CKC_ENT:
            if (timeout == SMTD_TIMEOUT_RELEASE) return 30;
            break;
        case CKC_BSPC:
            if (timeout == SMTD_TIMEOUT_RELEASE) return 30;
            break;
        case CKC_DEL:
            if (timeout == SMTD_TIMEOUT_RELEASE) return 30;
            break;
   }

    return get_smtd_timeout_default(timeout);
}

Yes, I still get some misfires, but the comparison is heaven and earth. before I customize the SMTD_TIMEOUT_RELEASE I can't barely type. The line above also fixes this issue #15.

I still get misfires, such as when typing "some, "which is interpreted as hold s + tap o. So, I think I will make the SMTD_TIMEOUT_RELEASE = 20.

Btw, any better approach if I wanted to set every macro key with the same value? rather than using redundant case ?

azzamsa commented 1 week ago

After adding these lines, it becomes more comfortable.

uint32_t get_smtd_timeout(uint16_t keycode, smtd_timeout timeout) {
    switch (keycode) {
        // left side
        case CKC_A:
            if (timeout == SMTD_TIMEOUT_TAP) return 300;
            if (timeout == SMTD_TIMEOUT_RELEASE) return 20;
            break;
        case CKC_R:
            if (timeout == SMTD_TIMEOUT_TAP) return 300;
            if (timeout == SMTD_TIMEOUT_RELEASE) return 20;
            break;
        case CKC_S:
            if (timeout == SMTD_TIMEOUT_TAP) return 300;
            if (timeout == SMTD_TIMEOUT_RELEASE) return 20;
            break;
        case CKC_T:
            if (timeout == SMTD_TIMEOUT_TAP) return 300;
            if (timeout == SMTD_TIMEOUT_RELEASE) return 20;
            break;
        case CKC_ESC:
            if (timeout == SMTD_TIMEOUT_TAP) return 300;
            if (timeout == SMTD_TIMEOUT_RELEASE) return 20;
            break;
        case CKC_SPC:
            if (timeout == SMTD_TIMEOUT_TAP) return 300;
            if (timeout == SMTD_TIMEOUT_RELEASE) return 20;
            break;
        case CKC_TAB:
            if (timeout == SMTD_TIMEOUT_TAP) return 300;
            if (timeout == SMTD_TIMEOUT_RELEASE) return 20;
            break;

        // right side
        case CKC_N:
            if (timeout == SMTD_TIMEOUT_TAP) return 300;
            if (timeout == SMTD_TIMEOUT_RELEASE) return 20;
            break;
        case CKC_E:
            if (timeout == SMTD_TIMEOUT_TAP) return 300;
            if (timeout == SMTD_TIMEOUT_RELEASE) return 20;
            break;
        case CKC_I:
            if (timeout == SMTD_TIMEOUT_TAP) return 300;
            if (timeout == SMTD_TIMEOUT_RELEASE) return 20;
            break;
        case CKC_O:
            if (timeout == SMTD_TIMEOUT_TAP) return 300;
            if (timeout == SMTD_TIMEOUT_RELEASE) return 20;
            break;
        case CKC_ENT:
            if (timeout == SMTD_TIMEOUT_TAP) return 300;
            if (timeout == SMTD_TIMEOUT_RELEASE) return 20;
            break;
        case CKC_BSPC:
            if (timeout == SMTD_TIMEOUT_TAP) return 300;
            if (timeout == SMTD_TIMEOUT_RELEASE) return 20;
            break;
        case CKC_DEL:
            if (timeout == SMTD_TIMEOUT_TAP) return 300;
            if (timeout == SMTD_TIMEOUT_RELEASE) return 20;
            break;
   }

    return get_smtd_timeout_default(timeout);
}

I try to use Monkeytype to detect misfires. Some I need to fix are:

image

image image image

But the good news is: the misfires happen very rarely.

stasmarkin commented 1 week ago

Btw, any better approach if I wanted to set every macro key with the same value? rather than using redundant case ?

You can define global timeouts in config.h with given line of code:

#define SMTD_TIMEOUT_TAP 300
#define SMTD_GLOBAL_RELEASE_TERM 20

So, every key will have that timeouts in get_smtd_timeout_default fuction. So you don't need to override them in get_smtd_timeout

stasmarkin commented 1 week ago

I recommend you to pay attention to weaker fingers. I have different timeouts for pinkies because their key release pattern is different from strong fingers.

azzamsa commented 1 week ago

I recommend you to pay attention to weaker fingers. I have different timeouts for pinkies because their key release pattern is different from strong fingers.

I avoided doing this, as I wanted to make all my fingers have the same timeouts consistency.

azzamsa commented 5 days ago

I recommend you to pay attention to weaker fingers. I have different timeouts for pinkies because their key release pattern is different from strong fingers.

Would you like to point the pinky config location?

azzamsa commented 5 days ago

I find CKC_A under your pinky, but I don't find it's custom value ?

azzamsa commented 5 days ago

I recommend you to pay attention to weaker fingers. I have different timeouts for pinkies because their key release pattern is different from strong fingers.

Now, I agree with this—many of the misfires involve the a key under my pinky. This is my current value, do you have any recommendations?

        case CKC_A:
            if (timeout == SMTD_TIMEOUT_TAP) return 300;
            if (timeout == SMTD_TIMEOUT_RELEASE) return 20;
            break;
stasmarkin commented 1 day ago

Sorry for wait, I had a busy week.

I find CKC_A under your pinky, but I don't find it's custom value ?

Did you manage to find it? If not, could you please specify what do you mean by "custom value"?

This is my current value, do you have any recommendations?

Does that work for you? Do you have any missfires and in which situations?

azzamsa commented 2 minutes ago

I'm seeking recommendations for the optimal values of SMTD_TIMEOUT_TAP and SMTD_TIMEOUT_RELEASE for my pinkies, as I'm still experiencing some misfires. Currently, I have 300 set for SMTD_TIMEOUT_TAP and 20 for SMTD_TIMEOUT_RELEASE.

The issue is that taps made with my pinkies are sometimes registered as holds. This typically happens when typing words like:

Note that a is under my right pinky, and o is under my left pinky.

I use the same settings for all other fingers without any issues.