PaperWM icon indicating copy to clipboard operation
PaperWM copied to clipboard

Holding down keyboard shortcut repeats action

Open mogenson opened this issue 5 years ago • 1 comments

Holding down a keyboard shortcut such as <Kbd>Super</Kbd>N or SuperReturn to create a new window will spawn new windows as fast as possible until the keys are released.

Holding down a keyboard shortcut such as SuperI to slurp a window will vertically tile all windows in the current column until all windows are consumed.

Can we make actions trigger on keyboard shortcut released so each action only fires once per key press.

I'm on commit 611680e on Arch Linux, Gnome shell 3.32.2

mogenson avatar Jul 30 '19 15:07 mogenson

Yeah, I agree that makes sense for some actions like new-window.

We'd probably want to add some option like repeat: false when enabling an action (akin to opensNavigator: true), so it's easy to handle in a generic way. (Another example where this would be helpful is super-escape which leak its key release event to the window, at least on wayland). This will require running all actions through a grabModal, but I'm fairly certain that shouldn't be a problem.

The best way to handle this is is probably handling the action on keypress, but then block further key press events until we've received a key release. That way we get the benefit of immediate response while still being able to avoid repeats (we do something similar when escaping navigation to avoid leaking the escape key release event).

hedning avatar Jul 31 '19 17:07 hedning