vispy.app.inputhook module

Support for interactive mode to allow VisPy’s event loop to be run alongside a console terminal, without using threads. This code relies on inputhooks built-in to the Python interpreter, and supports IPython too. The underlying inputhook implementation is from IPython 3.x.

Note that IPython notebook integration is not supported, as the browser does not use Python’s PyOS_InputHook functionality.

class vispy.app.inputhook.VisPyInputHook(manager)[source]

Bases: vispy.ext.ipy_inputhook.InputHookBase

Implementation of an IPython 3.x InputHook for VisPy.

This is loaded by default when you call vispy.app.run() in a console-based interactive session, but you can also trigger it manually by importing this module then typing:

>>> %enable_gui vispy
enable(app=None)[source]

Activate event loop integration with this VisPy application.

Parameters
appinstance of Application

The VisPy application that’s being used. If None, then the default application is retrieved.

Notes

This methods sets the PyOS_InputHook to this implementation, which allows Vispy to integrate with terminal-based applications running in interactive mode (Python or IPython).

vispy.app.inputhook.set_interactive(enabled=True, app=None)[source]

Activate the IPython hook for VisPy. If the app is not specified, the default is used.