Qt4’s inputhook support function
Author: Christian Boos
Create an input hook for running the Qt4 application event loop.
mgr : an InputHookManager
app : Qt Application, optional.
A pair consisting of a Qt Application (either the one given or the :
one found or created) and a inputhook. :
We use a custom input hook instead of PyQt4’s default one, as it interacts better with the readline packages (issue #481).
The inputhook function works in tandem with a ‘pre_prompt_hook’ which automatically restores the hook as an inputhook in case the latter has been temporarily disabled after having intercepted a KeyboardInterrupt.