swhkd icon indicating copy to clipboard operation
swhkd copied to clipboard

[Feature Request] Alow actions on on modifiers without a keysym

Open TTWNO opened this issue 3 years ago • 1 comments

Hi there,

I work on the Odilia screen reader project and I'd like to be able to make some slight modifications to be able to ship this with our project.

Is there any possibility that keysym could be optional for Keybindings? As in: Option<evdev::Key>

It is important to us that we may be able to stop caps lock (the "screen reader key") from passing through to the window manager if the user presses it in preparation for a key combo like caps + b to be able to navigation a webpage.

In addition, normally control is used to stop the screen reader from speaking if it's being too noisy.

I've attempted a solution, but there are some big issues that I can't quite figure out how to handle:

  1. Striking a valid key binding in the incorrect order can cause the modifier to be passed through to the WM. For example, if I have a keybinding capslock + b and type b + capslock, then the event associated with capslock + b will get triggered, but capslock will not get consumed and will be passed further down the stack.
  2. The above scenario also causes b to get triggered repeatedly, which I have seen before when we attempted an in-house input daemon earlier this year.

I'm not sure if this is possible to support, especially since we're on such a low level here. I've put my attempt at using options in a personal git repo here: sohkd if that's helpful.

Please let me know if I can be helpful; I won't sit here and ask for features that don't make sense for the project, especially without offering to make a PR.

Last question: would you consider this as a PR if I was able to get this feature working properly?

Thanks for all the hard work you do!

TTWNO avatar Aug 14 '22 19:08 TTWNO

Hi! I think we already implemented this.

capslock
    yourcommand 

If I interpreted the question incorrectly then please do let me know 😁. If not, I'm always open the patches and I'm also willing to collaborate on them.

Shinyzenith avatar Aug 15 '22 00:08 Shinyzenith

Closing to open more specific issues.

TTWNO avatar Oct 18 '22 23:10 TTWNO