How to capture keystrokes when GTK menu is open?



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

Hi,

I've been spending a bunch of time writing a gui application to create
learning software for applications.  (i.e. tutorials for Firefox, OOo,
any other app you can think of)

One of the core things this kind of application does is take screenshots
of whatever program is having learning software made for it.

i.e. "To Open a new Web Page", click File then Open (with screenshots of
Firefox there, mouse moving to the File menu, click, menu opens, mouse
highlights Open, click)

The screenshots are created by getting the program setup up correctly
then hitting the screenshot capture key (PrintScreen), moving to the
next bit, hitting the screenshot capture key again for the next
screenshot, etc.

However, with GTK I'm facing a real blocker at present. :(

Whenever any gtk program has it's menu open, keystrokes don't seem to be
processed for anything other than what's in the menu itself.  i.e. the
up, down, and enter keys work (and maybe shortcuts), and that's it.
(These keys move the selection up and down the menu that's open)

There doesn't seem to be a way to gets other keys fed through to things
expecting them.

I originally thought it was something like the main GTK event loop (?)
not processing things while a menu was open, so "no worries" I thought,
and coded up a small direct X application (no gtk) just to do the
screenshot capturing.  No luck.  It works fine, capturing keystrokes and
triggering when the PrintScreen key is hit... but once a GTK application
has a menu open, it too doesn't receive anything until the menu is closed.

I'm kind of drawing a blank on how to work around this, and doing some
kind of timed delay then screen capture thing is really just a hugely
non-optimal solution and won't make for good work flow. :(

So, recommendations on what to do from here?  Is there a way to tell GTK
to feed keystrokes onwards when a menu is open?

All other suggestions welcome of course. :)

Regards and best wishes,

Justin Clift

- --
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

iD8DBQFF2tzOFAuZn5lS2IMRAkY3AKCr0TRcCkOJ+kuZmk/sJVSXbIQJOQCeJAzB
CjDocRa9/HGv5zhAF4gvJbY=
=MsHM
-----END PGP SIGNATURE-----



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