dxhd icon indicating copy to clipboard operation
dxhd copied to clipboard

support for chord chains

Open dakyskye opened this issue 4 years ago • 5 comments

chord chains should be exactly same as they are in sxhkd.

dakyskye avatar May 27 '20 16:05 dakyskye

so, when we parse the config, we need to detect the event type for binding, that would introduce four new events: chord keypress, chord keyrelease, chord buttonpress, chord buttonrelease (probably). then, set relevant xevent events, and listen for EVERYTHING. Parser has to give us a map of string, containing arrays of string. Then, in the event listeners, we get what was pressed, if the map contains the keybinding, then, we set up a timer, passed as cmdline argument, and use the array of strings, which contain the next chords. if they match, we set up the timer again, and do that continuously unless we reach the last array index. Sounds easy to implement, parsing should also be easy.

However, my local tests did not satisfy me, since "listen for everything" did not work for RootWindow, but it worked for any existent window. As soon as I get it working for root win, chords gonna be implemented.

dakyskye avatar May 30 '20 13:05 dakyskye

There is GrabKeyboard, SmartGrab and DumnyGrab functions, which seem to be what's needed for chord chains, but they GRAB the whole keyboard, which is just a joke, no whole keyboard grabbing gonna happen. However, the Connect methods for event structs has a parameter, to grab or not grab a keybinding. I am really wondering what happens when I do not grab a keybinding (tried it, I doubt it does anything, since it has no effect). Have to investigate.

dakyskye avatar Jun 04 '20 13:06 dakyskye

I looked into this a bit in sxhkd and I don't think that listening for everything will work. I think that you've got to listen for every one of the possible keypresses that you may hit, individually.

erwin avatar Dec 09 '21 11:12 erwin

Thanks for the interest and this investigation 👍 right now top priority is to rewrite dxhd because current codebase is horrible and once it's done I can look into getting chord chains supported.

dakyskye avatar Dec 09 '21 11:12 dakyskye

What is the status on this feature?

Reikimann avatar Feb 23 '22 12:02 Reikimann