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

Additional Mouse Action #133

Open
simlu opened this issue Dec 28, 2016 · 2 comments
Open

Additional Mouse Action #133

simlu opened this issue Dec 28, 2016 · 2 comments

Comments

@simlu
Copy link

simlu commented Dec 28, 2016

I'm trying to extend functionality for mouse buttons, so that we can hook other functionality plus the existing one (I.e. The left mouse button should still pass through to the program Gui, but also do other things).

This is the only somewhat successful attempt I could find, and I couldn't get it to work with the latest xmonad version:
http://stackoverflow.com/questions/18304191/keyboard-free-mouse-gestures-for-xmonad

Will this require changes to the core or the contrib? Or is there a better solution we can define in xmonad.hs already?

@geekosaur
Copy link
Contributor

Some notes on that SO answer:

  1. there is clickJustFocuses = False in recent (0.11 and later) xmonad, which passes clicks through. This is not general, however.

  2. xdotool, and the equivalent functionality from XMonad.Util.Paste, uses sendEvent (man 3 XSendEvent). The big caveat is that all events sent this way are marked by the X server as synthetic, and some programs and toolkits will ignore synthetic events.

  3. xmonad uses passive pointer (and keyboard) grabs for its mouse and key bindings. This ensures that the events in question always are given to xmonad... and that nothing else can ever see them. (Clicking to focus is a separate mechanism.) You cannot bind a mouse event in the normal way and also have it go to the client. What you can do, is register interest in general mouse events (which will then be sent to xmonad as well as to the clients; see clientMask and rootMask) in the root window and/or client windows, then intercept them in handleEventHook. Note that this means xmonad will be receiving a lot of extraneous events with this method.

@simlu
Copy link
Author

simlu commented Dec 28, 2016

Ah, that was good input. I'll test out some stuff and circle back here!

This seems like a promise reference for keys: http://stackoverflow.com/questions/6605399/how-can-i-set-an-action-to-occur-on-a-key-release-in-xmonad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants