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

[Question] Overload + Double Tap? = Capslock = esc on tap, control on hold, capslock toggle on doubletap within X ms? #879

Open
chris4prez opened this issue Nov 16, 2024 · 3 comments

Comments

@chris4prez
Copy link

I'm loving the functionality from keyd as it's allowing me to mimic a lot of the configurations I have within QMK for my mech keyboards on my laptop keyboards; however, I'm being challenged to get the following to work. Is this possible?

Capslock Single tap = ESC
Capslock Hold = CTRL
Double Tap Capslock (within X ms) = Toggle Capslock

@nsbgn
Copy link

nsbgn commented Nov 16, 2024

I would think along the following lines first:

[global]
# oneshot_timeout = your X ms

[main]
capslock = overload(control, oneshot(capslock))

[caplock]
capslock = capslock
a = macro(esc a)
b = macro(esc b)
#... etcetera

... but this doesn't do exactly what you want because the esc action would only be triggered if you press another key quickly. The behaviour suggested in #738 would remedy this.

Another attempt:

[main]
capslock = overload(control, toggle(caps))

[caps]
capslock = togglem(caps, capslock)
a = togglem(caps, esc a)
b = togglem(caps, esc b)
#... etcetera

... but this would mean you lose the timeout on the double tap. This, in turn, would be addressed by the feature request in #671.

Either approach is also rather verbose. There are a couple of feature requests that would address this, so hopefully this sort of thing will be easier in later versions (ie. #681, #705).

Sorry to reference all these open feature requests, but I guess it's good to keep track :P

@chris4prez
Copy link
Author

Thanks for compiling all of this and confirming what I suspected; there appears to be no clean functional way to perform this at this time.

As you mentioned hopefully this will be solved at some point as it seems to be a somewhat common scenario once you go down the hole of optimizing your keystrokes and trying to leverage ability to stay on home row as much as possible without removing functionality at the same time.

@aiyagari
Copy link

While I can't do exactly what you're saying, I can come quite close with existing functionality:

  • Tap = Esc
  • Hold = Ctrl
  • Hold longer in isolation only = CapsLock
[main]
capslock = timeout(overload(control, esc), 800, capslock)

I am using 800ms, for the CapsLock hold time, but you can adjust it of course. The nice thing is that once you strike another key in combination with CapsLock, then the timer is cancelled and there is no danger of engaging CapsLock.

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

3 participants