You can install an event filter on any QObject. When you want to capture the tab key, say while a particular window is open, you could install an event filter on that window. This window will now receive events that you will handle in a custom fashion with your code.
This link is a good starting point: http://riverbankcomputing.com/static/Docs/PyQt4/html/qobject.html#installEventFilter Make sure to either accept() or ignore() your event once it gets to your handler. This will ensure correct propagation, so other subscribers, such as you point out, will receive the event in the case you are not interested in it. -Judah On Mon, Nov 5, 2012 at 7:36 AM, Marcus Ottosson <[email protected]>wrote: > Maya doesn't seem to support it via it's hotkey editor. I'm a Qt user and > have tried taking ownership of the tab key via overriding maya's own > keyPressEvent() without luck, I suspect it might work in versions prior to > 2013 though due to their own usage of the tab-key in the node editor, > although I have yet to confirm this. > > Anyone have any ideas? Preferably I'd like to keep the native tab > functionality of switching between text- and num-fields and only have it > active when regular hotkeys are active. > > Best, > Marcus > > -- > view archives: http://groups.google.com/group/python_inside_maya > change your subscription settings: > http://groups.google.com/group/python_inside_maya/subscribe > -- view archives: http://groups.google.com/group/python_inside_maya change your subscription settings: http://groups.google.com/group/python_inside_maya/subscribe
