[pygtk] Intercepting shortcuts/accelerators
jpe at wingide.com
Thu Nov 11 23:55:48 WST 2004
Arjan Molenaar wrote:
> Does anyone have an idea how to do this? It looks to me like it's a bit
> more complicated than "just" connecting to Window::key_pressed_event.
It's not that much more complicated (I'm assuming you're using gtk 2.x)
-- you can connect to Window::key_pressed_event to inspect key events
before they are dispatched to widgets. If you return false, the default
key dispatching machinery will be called, but it will be bypassed if you
return true. I've used this mechanism to implement global key-bindings
and it works reasonably well.
Let me know if you have specific questions or problems,
More information about the pygtk