UltimateHackingKeyboard / agent

Ultimate Hacking Keyboard configurator
https://ultimatehackingkeyboard.github.io/agent/
Other
702 stars 77 forks source link

Chord management interface #2346

Open Penguin-Guru opened 1 month ago

Penguin-Guru commented 1 month ago

This is a feature request and me sharing my thoughts for discussion on how it might be designed. I don't actually know much about the current macro language or software architecture, so there may well be things I've overlooked or misunderstood.

I would like to have a new section on the navbar for chord dictionaries. These dictionaries could be created and deleted, enabled and disabled, and imported and exported, like keymaps or macros. The way I imagine this working is that multiple dictionaries could be enabled at the same time, so users can organise their chords somewhat, but conflicts should be reported to the user and resolved by simply highlighting and ignoring earlier defined chords (higher in the same dictionary or in a higher listed dictionary) in favour of later defined ones. I imagine each dictionary consisting of:

Despite this interface being designed for chords, I think it makes sense for the chord actions to essentially be any sort of macro action or sequence of actions. In the case of sequences of actions, it might be necessary to keep track of which are still executing and should perhaps block others. This sort of functionality could be added later. It might even be useful to have different types of dictionaries for text entry chords, dictionaries for other sorts of macros, and dictionaries that include both. These could be easily distinguished by a letter or symbol, in an effort to protect users who might blindly download and install large dictionaries of macros.

The user experience for handling conflicts is probably important to consider. Conflicts between active dictionaries should probably be detected during composition of new chord definitions.

I also think it would be useful to offer a simple mechanism by which to limit the scope of certain chord dictionaries to certain keymaps.

This sort of interface might also be useful for non-word-based applications, such as dictionaries of chords to enter unicode characters or emoji. For example...

mhantsch commented 1 month ago

I think you've captured some good use cases for chords, and why they should be easier to configure.

Forum discussion that deals with chords: https://forum.ultimatehackingkeyboard.com/t/chorded-escape-q-w-example-configuration-feature-brainstorming/1429

In addition to an implementation in Agent, this will need some firmware support.

mondalaci commented 1 month ago

We won't implement a full-blown interface like suggested, but I plan to make chords easier to use via parametric smart macros, which I'll specify later.

Penguin-Guru commented 1 month ago

Alright. I can't guess what that would look like so I will just look forward to seeing it. 🙂

Perhaps some day someone more invested in chording will have more thoughts to share. It does seem to be an increasingly popular topic.

mhantsch commented 1 month ago

I plan to make chords easier to use via parametric smart macros

Parametric smart macros may make some chords a little bit easier to configure, but not much. If you use any decent number of chords, you will still need many macros, esp. when for some chords the starting keys overlap. I really believe for a proper chording implementation you need a "chord list" (trie) somewhere in the firmware, processed before regular key processing, which activates either actions directly, or pushes virtual keypresses onto the postponer queue.

I suggest leaving the design to a later stage until it has mentally ripened (like good wine, some software design needs to age).

Penguin-Guru commented 1 month ago

For context, I believe CharaChorder introduces new users with the 400 most common words. The actual number of words most serious users have installed is undoubtedly higher-- probably in the thousands. Some users will want to extend that to include things like unicode, emoji, and multiple languages (including syntax for programming languages).