Skip to content
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

Listen for keybindings containing more than one non-modifier key? #74

Open
peteruithoven opened this issue Jan 15, 2017 · 1 comment
Open
Labels

Comments

@peteruithoven
Copy link

Is there any way for Quicktile to respond to multiple keys, beside the modifier keys? Like tiling a window to top-left when modifier keys + up + left keys are pressed?

@ssokolow
Copy link
Owner

ssokolow commented Jan 15, 2017

Probably not currently. I don't think the underlying XGrabKeyAPI allows claiming combinations containing more than one non-modifier key.

However, it IS theoretically possible. You'd want to:

  1. XGrabKey both modifier keys + up and modifier keys + left when QuickTile starts.
  2. When either is pressed, call XGrabKeyboard like a screen-locker would.
  3. If the last key in the chord is pressed, make a note of it so it can be acted on.
  4. No matter what happens, call XUngrabKeyboard as soon as a single key press/release event has occurred.

...or, if you want to support Emacs-style non-chorded sequences like xbindkey does, only call XUngrabKeyboard for key press events, so releasing the first chord doesn't release the grab.

@ssokolow ssokolow changed the title Listen to multiple keys? Listen for keybindings containing more than one non-modifier key? Jan 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants