Skip to content

[BUG] Collection of bugs in combo logic #1107

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

Open
anoburn opened this issue Apr 26, 2025 · 0 comments
Open

[BUG] Collection of bugs in combo logic #1107

anoburn opened this issue Apr 26, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@anoburn
Copy link

anoburn commented Apr 26, 2025

There are currently several bugs in the logic of the combo module (as mentioned on [Zulip](#KMK development > Combo behavior on key release).
For the test examples, I assume the default test layer from the combo unittests: [KC.A, KC.B, KC.C, KC.D, KC.E, KCMO, KC.F, KC.G] and the same general setup.

BUG 1

A small one: when match_coord=True and only a 0 remains for a combo (remaining = [0]), this will result in any(remaining) = False, triggering combos even though the 0-key has not been pressed. For example:

combos = [
    Chord((0, 1), KC.X, match_coord=True)
]

keyboard.test(
    'bug1',
    [
        (1, True),
        (1, False),
        t_after,
    ],
    [{KC.B}, {}],
)

The actual result is [{KC.X}, {}] because the 0 is not taken into consideration.

I've already fixed this one (see here, but hadn't opened a pull request so far because I was expecting a bigger rewrite for other things (see also the [Zulip post](#KMK development > Combo behavior on key release). I can still make a PR, if wished.

BUG 2

When two combos overlap and the first one is not completed, this will prohibit the second combo from triggering. For example:

combos = [
    Sequence((KC.A, KC.B, KC.C), KC.X),
    Sequence((KC.B, KC.D), KC.Y),
]

keyboard.test(
    'bug2',
    [
        (0, True), (0, False),
        t_within,
        (1, True), (1, False),
        t_within,
        (3, True), (3, False),
        t_after,
    ],
    [{KC.A}, {}, {KC.Y}, {}],
)

The actual result will be [{KC.A}, {}, {KC.B}, {}, {KC.D}, {}]

BUG 3

Combos don't trigger if typed too fast and another combo was still matching. For example:

combos.combos = [
    Chord((KC.A, KC.B), KC.X, timeout=3 * timeout),
    Chord((KC.A, KC.B, KC.C), KC.Y),
]
keyboard.test(
    'bug3',
    [
        (6, True),
        (7, True),
        (6, False),
        (7, False),
        t_after,
        (6, True),
        (7, True),
        (6, False),
        (7, False),
        3*t_after,
    ],
    [{KC.Z}, {}, {KC.Z}, {}]
)

The actual result are only the raw inputs, with no combos being activated {'A'}, {'A', 'B'}, {'B'}, {}, {'A'}, {'A', 'B'}, {'B'}, {}.
I guess one could argue this is intended behavior and is more of a feature request than a bug report, but this way combos are pretty much unusable when typing at higher speeds.

@anoburn anoburn added the bug Something isn't working label Apr 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant