Closed dannyglover closed 5 months ago
I don't have an environment that supports Alt-Tab but I think I get what you mean
I'll probably do some tests on a live USB with Gnome or KDE and see if I can come up with something
I don't have an environment that supports Alt-Tab but I think I get what you mean
I'll probably do some tests on a live USB with Gnome or KDE and see if I can come up with something
No rush :)
I guess this functionality goes against the grain of your current implementation... As getting this to work will require a modifier to hold a key down (alt) and another to press a key once per press (tab) to get the functionality working correctly.
Naturally, the press part of that problem is already taken care of. It's just the holding part that needs solving.
Yes that's part of the issue, I'd like to solve it without breaking a bunch of other use cases, but it may be doable
Yes that's part of the issue, I'd like to solve it without breaking a bunch of other use cases, but it may be doable
I don't know if you'll like these ideas, but I have some suggestions that would extend the existing config system, without requiring new stuff.
BTN_SELECT-BTN_TL2 = ["KEY_LEFTALT-HOLD", "KEY_TAB"]
This one could be parsed simply with some good ole' string substring stuff. Don't detect a hypen? Default "press" behavior. Kind of goes along with your BTN_X-BTN-Y system.
BTN_SELECT-BTN_TL2 = ["KEY_LEFTALT-HOLD", "KEY_TAB", "HOLD", "PRESS"]
OR BTN_SELECT-BTN_TL2 = ["KEY_LEFTALT-HOLD", "KEY_TAB", ["HOLD", "PRESS"]]
This is more complicated syntax for the user, but an option.
Adding either of the options could allow for some powerful keybinds. In the case of either option, I'd suggest making the "hold" key release after the user releases either the first key (select in this case), or all the keys in the modifier. My interpretation of modifiers is that the first key/button in the sequence is the "activator" key/button.
The way it works is that when you press modifiers in any order, they're stored in a vector, then when you press a key that's not tagged as a modifier, it checks if the currently pressed modifiers match any of the mappings, if they do, then it fires the associated sequence, otherwise it fires the default event
Currently, if any of the modifiers in use is lifted while you're pressing a mapped combination, the associated sequence is automatically lifted as well, which is how combinations usually work in an OS
The key sequence on the right, however, is directly parsed as a Vector of evdev::Key events, which means that by adding the "HOLD" part, it would have to be parsed as a Vector of Strings and change some other stuff so it's not exactly drop-in
I might do it if it's necessary, but I'll consider the options and see which one is the most clean
Thanks for the suggestions
Hello! I've released v0.8.2 which includes support for this feature
The syntax for your case would be:
BTN_SELECT-BTN_TL2 = ["KEY_LEFTALT"]
-BTN_TR2 = ["KEY_TAB"]
The dash in front of the keybinding means that it can be chained with other combinations, so you can press Select and TL2 to act as Alt, and then tap TR2 as if you were tapping Tab
Currently, using it alone will still emit the Tab event, but I can change that (or I can add a setting to change the behavior), what do you think?
I've tried keeping the syntax as simple as possible
Edit: i've released v0.8.3 and v0.8.4 with a new setting (CHAIN_ONLY
) to control whether the chained binding should emit its event or not when pressed alone
Hello! I've released v0.8.2 which includes support for this feature
The syntax for your case would be:
BTN_SELECT-BTN_TL2 = ["KEY_LEFTALT"] -BTN_TR2 = ["KEY_TAB"]
The dash in front of the keybinding means that it can be chained with other combinations, so you can press Select and TL2 to act as Alt, and then tap TR2 as if you were tapping Tab
Currently, using it alone will still emit the Tab event, but I can change that (or I can add a setting to change the behavior), what do you think?
I've tried keeping the syntax as simple as possible
Edit: i've released v0.8.3 and v0.8.4 with a new setting (
CHAIN_ONLY
) to control whether the chained binding should emit its event or not when pressed alone
Absolutely fantastic work! I love the edition of CHAIN_ONLY
. I pulled the latest changes and tested, and it works perfectly.
Great job!
Me again :)
So I have one last binding I'm trying to get working, Alt+Tab. I'm trying to get it so that one modifier combo keeps the tab switcher open, whilst an additional modifier acts the same as holding the Alt key on the keyboard down, and pressing tab once at a time to change the active selection.
Failed attempts:
Any ideas how to get this working as intended? Thanks again and thanks for your continued patience :)