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

to_if_alone reaction time seems slow [question] #3096

Closed
mduboule opened this issue May 26, 2022 · 8 comments
Closed

to_if_alone reaction time seems slow [question] #3096

mduboule opened this issue May 26, 2022 · 8 comments

Comments

@mduboule
Copy link

First, thank you for this incredible software.

I'm remapping caps lock to left_control or escape if alone using the e0da rule. There is a slight delay when pressing caps lock alone for the escape to trigger. It's nothing crazy but it's 300 or 400 ms slower than using the real escape key. I've tried playing with the parameters without success, did I miss anything? Is there a way to lower this delay?

I'm a big vim user and it makes the experience sluggish. Thanks in advance!

M1 Max
karabiner-element 14.4.17
Monterey 12.3.1
External Magic Keyboard (same on the macbook's keyboard though)
And that's the only definition I have in my karabiner.json file, except for the fn key definition.

@trcoffman
Copy link

trcoffman commented Jun 10, 2022

Yeah, I was just experiencing this same issue. I fixed it by configuring the to_if_alone_timeout_milliseconds on my rule.

@mduboule
Copy link
Author

Ah good point, thank you @trcoffman! I was able to get to a better experience setting that value at around 140 milliseconds. I'b be curious to know what value works for you. I think when I was messing with it earlier, the value was probably too short for the command to even register.

But it's still 140ms longer than pressing escape though, maybe that's just the way it has to be. I was hoping it could detect as soon as the key up event is triggered that the key was pressed alone.

@ucasyfp
Copy link

ucasyfp commented Jun 25, 2022

@mduboule just found a solution, set lazy to true, which is false by default.
#3053 (comment)

@mduboule
Copy link
Author

That's awesome, thank you so much @ucasyfp! It really changes my entire typing experience. This is the end result if anyone is curious. And I set basic.to_if_alone_timeout_milliseconds back to 1000ms.

        "rules": [
          {
            "description": "Caps lock to control; but to escape if alone",
            "manipulators": [
              {
                "type": "basic",
                "from": {
                  "key_code": "caps_lock",
                  "modifiers": {
                    "optional": ["any"]
                  }
                },
                "to": [
                  {
                    "key_code": "left_control"
                  }
                ],
                "to_if_alone": [
                  {
                    "key_code": "escape",
                    "lazy": true
                  }
                ]
              }
            ]
          }
        ]

@ayoola-moore
Copy link

ayoola-moore commented Oct 6, 2022

Hey, I am experiencing a lag with 'e'. This is what my configuration looks like. Am I doing any thing wrong here

"rules": [ { "description": "E to HYPER (SHIFT+COMMAND+OPTION+CONTROL) or ESCAPE (If Alone)", "manipulators": [ { "from": { "key_code": "e", "modifiers": { "optional": ["any"] } }, "to_if_alone": [ { "key_code": "e" } ], "to_if_held_down": [ { "key_code": "left_shift", "modifiers": [ "left_command", "left_control", "left_option" ] } ], "type": "basic" },

@martisj
Copy link

martisj commented Mar 23, 2023

Hey, I am experiencing a lag with 'e'. This is what my configuration looks like. Am I doing any thing wrong here

"rules": [ { "description": "E to HYPER (SHIFT+COMMAND+OPTION+CONTROL) or ESCAPE (If Alone)", "manipulators": [ { "from": { "key_code": "e", "modifiers": { "optional": ["any"] } }, "to_if_alone": [ { "key_code": "e" } ], "to_if_held_down": [ { "key_code": "left_shift", "modifiers": [ "left_command", "left_control", "left_option" ] } ], "type": "basic" },

Looks like you are not using the lazy option?

@martin-braun
Copy link

lazy didn't help for me, it made my mapping not work. No, my issue was I have set basic.to_if_alone_timeout_milliseconds to a low value, but it would mean if the timer runs out, my mapping won't go through. Default value of 1000 is absolutely reasonable and fixed my issue.

@xzbdmw
Copy link

xzbdmw commented Mar 28, 2024

That's awesome, thank you so much @ucasyfp! It really changes my entire typing experience. This is the end result if anyone is curious. And I set basic.to_if_alone_timeout_milliseconds back to 1000ms.

        "rules": [
          {
            "description": "Caps lock to control; but to escape if alone",
            "manipulators": [
              {
                "type": "basic",
                "from": {
                  "key_code": "caps_lock",
                  "modifiers": {
                    "optional": ["any"]
                  }
                },
                "to": [
                  {
                    "key_code": "left_control"
                  }
                ],
                "to_if_alone": [
                  {
                    "key_code": "escape",
                    "lazy": true
                  }
                ]
              }
            ]
          }
        ]

Hmm, still has a slightly delay

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

7 participants