Skip to content

Key Chords #1505

@firngrod

Description

@firngrod

It’s been talked about before, but recently, while figuring out a way to cram mouse buttons into the “comfort zone” of my layout, I turned to chording, and I find that I really like the concept. It is kind of a pain to set up with macros though, and even more so to maintain. I have four chords between three buttons, so each macro has to align with two others about three chords each. That is already rather intricate.

So I was wondering if it could become a feature of the keyboard. I think it has been previously suggested and considered, but ultimately turned down? I do have an idea on how it might be done without too much impact on the rest of the code.

Basically, a list of chords would live somewhere. On initial parsing of that list, buttons would be marked as chord-members in their actions. Then if a chorded key is pressed, ifShortcut-style logic is applied, with a configurable timeout, evaluated with regards to whatever chords the key are member of. Then, if a chord is detected, that chord applies to those keys, if not, normal key action applies. If more chords are valid, delay until (one of) the largest is achieved, or until timeout, then apply largest available, breaking ties with first completed. If any key is pressed which is not part of any registered chord with the initiating key, chord is broken and normal key logic resumes. Macros could be run, their values would be set to the values of the first key pressed in the chord. Possibly, an ifChord conditional could be implemented. Chord release would be on release of the first pressed key, in alignment with macro variables.

Chords would be configured independently of keys, but on a per-layer basis as "custom keys", as a list of chords, each containing a list of buttons, and an action which can be configured like keys can. Right now, I don't see any technical reasons why any of the actions available to the user in UI should be impossible, although secondary roles might be a little tricky. Possibly a limit on chord count and keys per chord to manage RAM, possibly living in the same memory-space as macros, which I don't think live in RAM, and can have arbitrary sizes?

It seems like a fun project, and I am probably going to look into making a proof of concept sometime in the not too distant future. I would appreciate any input. I will likely need some guidance from maintainers on some things, such as where the list of chords could live and so on if this is to have any chance of becoming merge-worthy.

EDIT: Added some clarifications

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions