-
-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Allow overlapping combos #6029
Allow overlapping combos #6029
Conversation
Well, you can run Or you ran run Also, if you did this locally, you probably ran If it's the fine in question that is causing the issue, you can forcibly disable tracking on it, if it's a git issue. |
f4b5ece
to
5eaeb52
Compare
I cleaned this up a little moving to a function and fixed it so the combo works instantly if a non-combo key is pressed. R.e. the git comments, what I mean is that git is actually completely broken for me without including that commit, which I did intentionally. e.g.
If #6028 is merged soon, then this will be moot, but if it doesn't get merged soon I can figure out how to rebase this. Likely by doing it in a docker image or something. And then curse OSX for being case insensitive by default :) |
…ld down I wanted to have multiple combos on the home row, that overlapped - e.g. `SDF` for shift and `DF` to change layers. However the combos were sent immediately as they were pressed, so I might change layers when I really wanted to shift. I've added a COMBO_ONLY_SEND_LONGEST_COMBO flag that will debounce the combos and only send the longest one, allowing overlapping independent combos like this
5eaeb52
to
e3307c4
Compare
Oh it did just get merged - I rebased fine now, thanks! |
This is potentially a duplicate of #5527. |
I don't think this should be behind a flag—it should just be how the Combo feature works. The previous behavior of triggering all sub-combos is unintuitive. If there is some use case for the old behavior, then maybe introduce a flag with the opposite meaning. |
I agree with @noahfrederick actually. |
So, thinking about this, I think it might be best to have both. I.e., update Whilst it's hard for me to articulate a concrete use case for I guess it just feels right, because you can implement the debounced behaviour in userspace if you only have the immediate behaviour in core, but not the other way round. Either way, I'm going to do some refactoring here and see if I can hash that implementation out a little better. I've also found a little bug in my implementation: although the presses are debounced, the release of the combos still send releases for each combo. This probably isn't an issue most of the time if you're just doing Would you prefer I close this PR and come back with a new one later, or leave it open until I do the refactoring? |
Both may be best, but I still think that the "send longest" should be the default behavior. We can hide the older method behind preprocessor lines. |
There is a merge conflict here. Could you rebase and fix this? |
Any update on this? |
Hi, I used this a little on my own board and I found that it's a bit unreliable - I've been meaning to come around and figure out why and get it more reliable. I was trying to figure out if I could write some tests that would help me try out all the cases however I didn't find a way to do that kind of testing, and that's about as far down the rabbit hole as I got :( |
Thank you for your contribution! |
Thank you for your contribution! |
@alexspeller Did you manage to figure out where the unreliability came from or do any further work? Asking before I take a stab at this. Would like to get this merged into core as a few of my boards a 100+ combos on them :P |
@germ unfortunately not, I took a different approach to my keymap in the end without any overlapping combos |
Damn. You mind if I use this PR as a starting point for my own work @alexspeller ? |
@germ please feel free, if you get it working I'd love to try it out again myself! |
Description
Add option to only send the longest combo when multiple combos are held down
I wanted to have multiple combos on the home row, that overlapped - e.g.
SDF
for shift andDF
to change layers. However the combos were sent immediately as they were pressed, so I would change layers when I really wanted to shift.I've added a
COMBO_ONLY_SEND_LONGEST_COMBO
flag that will debounce the combos and only send the longest one, allowing overlapping independent combos like this.This still allows combos to be used as modifier keys - it only delays sending the combo by
COMBO_TERM
.I am far from a competent C programmer so I might be doing stupid stuff here.
Types of Changes
Issues Fixed or Closed by This PR
Checklist