-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any way to prevent repeating commands? #156
Comments
Nope. Key-bindings are executed on key-down. It could be possible with a key-press or key-up method, or with a repeat parameter which tells whether the key combination is being held down. https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat |
from the manual
|
Sorry, I forgot to mention that I had already tried that and it didn't produce any different result from the default (as far as I can tell). |
If this is still an issue, could you share the snippet in question? Prefixing |
I am not sure I am using |
No, you did explain it perfectly well. I tried it myself and came to the same result as you did.
This would work if keeping a key pressed would result in multiple KeyPress events but only in a single, final KeyRelease event. Using Unfortunately, it doesn’t seem possible to make sxhkd react only to the final KeyRelease event. My conclusion: No, you cannot accomplish what you want using sxhkd only. You could maybe achieve something similar using chords, though. |
@smeikx There seems to be a way to detect autorepeating keys using the XCB equivalent of XkbSetDetectableAutoRepeat, see https://stackoverflow.com/a/41403168 You could then expose this in sxhkd by providing a modifier that executes a command only once per key{press,release}. |
Is there any way to prevent the command to keep being repeated when I am holding a key, so when I press the keys but keep holding them, it only executes the command once?
Edit: I tried adding @ at the beginning of the keysym and as far as I can tell, it didn't produce any effect.
The text was updated successfully, but these errors were encountered: