[pygtk] Propagation of keyboard events
Osmo Salomaa
otsaloma at cc.hut.fi
Tue Dec 30 10:40:55 WST 2008
Hello list,
Let's say I've written an application with various keybindings, e.g.
Ctrl+C for copying, bound to a UI manager action. Now I notice that I
want to put an entry in the application main window and in that entry I
want Ctrl+C to be bound to the basic built-in text copying of the entry.
How do I best avoid triggering the application-level UI manager action
when in that Entry? Is there an easier way than setting sensitivities of
action groups on focus-in and focus-out events on that entry?
In the PyGTK FAQ I find [1]
Keyboard events are handled differently. When your window
receives a keyboard event, it is first dispatched to the
toplevel window, which will check if it matches any keyboard
shortcuts. If the key press doesn't match a shortcut, then the
event is dispatched to the child widget that currently has
focus.
Basically, I'd want the propagation to work the other way around.
[1] http://faq.pygtk.org/index.py?req=show&file=faq03.011.htp
--
Osmo Salomaa <otsaloma at cc.hut.fi>
More information about the pygtk
mailing list