Re: How to capture keystrokes when GTK menu is open?



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

Tristan Van Berkom wrote:
On Wed, 2007-02-21 at 08:27 +1100, Justin Clift wrote:
[...]
Unsure if it gives keyboard events for the whole window system or not,
but I'll play with it and find out!

Heh no it wont, David pointed out one way of getting at "all" keyboard
events - basically you need permission from the X server - as a GUI
application - its not in your rights to recieve all keyboard events,
you only get keyboard events when a window in your application has
keyboard focus, this is not a limitation of GTK+ but a limitation
of the X server (the server just wont send the events to the client).

Hmmmm, not sure about that.

If I open a new connection to any X display, using Xlib rather than GTK,
I can do a request and receive all the keyboard events that are
processed through that display.

This is the code for xkey, a very simple X keyboard sniffer Google
turned up last weekend while trying to figure out how to get around this
problem:

  http://wiki.hping.org/135

That's able to receive key events... again except for when a gtk menu is
open.  (ugh)

So, the above example is providing me hope that there may be some
workaround somewhere that's usable, rather than chucking away 6 months
of coding and writing off any hope of ever having decent learning
materials for GTK based apps. ;->

Regards and best wishes,

Justin Clift


Cheers,
                  -Tristan


- --
The Flame Project - Open Source GUI for animated SVG & Flash
http://www.flameproject.org

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

iD8DBQFF2238FAuZn5lS2IMRApSpAJ9uPvkNGX59nGIVA2w4zMKKWcSZ2wCfYpwd
l+sFG6nj3Dghl2mJ+3HNQQE=
=VHAr
-----END PGP SIGNATURE-----



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]