Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration from Miryoku #14

Open
azzamsa opened this issue Sep 6, 2024 · 15 comments
Open

Migration from Miryoku #14

azzamsa opened this issue Sep 6, 2024 · 15 comments

Comments

@azzamsa
Copy link

azzamsa commented Sep 6, 2024

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 azzamsa changed the title M,rt. Migration from Miryoku Sep 6, 2024
@azzamsa
Copy link
Author

azzamsa commented Sep 6, 2024

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
Copy link
Author

azzamsa commented Sep 7, 2024

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:

  • Sometimes I get 0 after typing numbers

image

  • Sometimes I get a capital letter after the first capital letter

image
image
image

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

@stasmarkin
Copy link
Owner

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
Copy link
Owner

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
Copy link
Author

azzamsa commented Sep 9, 2024

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
Copy link
Author

azzamsa commented Sep 11, 2024

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
Copy link
Author

azzamsa commented Sep 11, 2024

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

@azzamsa
Copy link
Author

azzamsa commented Sep 12, 2024

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
Copy link
Owner

stasmarkin commented Sep 15, 2024

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
Copy link
Author

azzamsa commented Sep 17, 2024

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:

  • tny
  • lcation
  • bulnan

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.

@azzamsa
Copy link
Author

azzamsa commented Sep 25, 2024

@stasmarkin sorry for the ping, do you have any input? 🙏🏽

@stasmarkin
Copy link
Owner

Well, the only suggestion here is to reduce SMTD_TIMEOUT_RELEASE until you find a sweet spot.
All the magic in sm_td is in this release timeout, so if you reduce SMTD_TIMEOUT_RELEASE to 1, you will get the default qmk behavior.
If you are getting misfires even with almost zero SMTD_TIMEOUT_RELEASE, then there is nothing you can tune to make it better right now. But I have a task in the backlog to handle this "sticky pinky" with negative timeouts

@stasmarkin
Copy link
Owner

Hi there! I'm about to release a new version, that should fix this issue. Please, take a look on that ticket: #30

@azzamsa
Copy link
Author

azzamsa commented Jan 5, 2025

Wow, what a breath of fresh air.

I’ve been checking this repository periodically and was starting to think it had been abandoned since there hadn’t been any new commits in over five months. I frequently experience occasional misfires—it’s rare but still frustrating. Unfortunately, I’ve struggled to find the optimal configuration for my workflow. Experimenting with a wide range of numbers has been exhausting, and I’ve been wishing the library could automatically determine whether an input is a hold or a tap without requiring me to figure out the perfect value.

I was on the verge of switching to a different firmware because of this, but today’s response has given me hope. I’m looking forward to seeing if v5 can improve my situation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants