How can I catch all mouse events?j

Benjamin M. Schwartz bmschwar at fas.harvard.edu
Mon Jun 2 18:36:40 PDT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Daniel Stone wrote:
| On Mon, Jun 02, 2008 at 03:06:09PM -0400, Benjamin M. Schwartz wrote:
|> I am trying to do something very simple: change the default cursor
|> whenever a mouse button is pressed down, and change back when the button
|> is released.  For example, a normally black cursor graphic might be
|> switched out for one with a white fill to indicate that a mouse button is
|> depressed.  This would be useful for audiences watching a demonstration on
|> a projector, or even looking over a friend's shoulder if you can't hear
|> the audible click.  There are also obvious applications to MPX, but that
|> is more advanced.
|>
|> Question 1: How would you implement this?
|
| XGrabButton.

Beautiful!  I tried running an Async XGrabButton on the root window, and
it works.  However, despite being in Async mode, the mouse button presses
never reach the underlying window.  I can't click on anything until I kill
my program, because it's absorbing all the button presses.  What am I
doing wrong?  How do I allow the button press event to continue propagating?

- --Ben
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkhEoCgACgkQUJT6e6HFtqQ13gCghZR/PN9C3zjUMJ07/LDS4u4s
5+UAoJ6BImZ4gNExu2SlCDj7TxuNKawy
=m7Fp
-----END PGP SIGNATURE-----



More information about the xorg mailing list