displayarray.input

Mouse Input

class mouse_loop(f)[source]

Run a function on mouse information that is received by the window, continuously in a new thread.

>>> @mouse_loop
... def fun(mouse_event):
...   print("x:{}, y:{}".format(mouse_event.x, mouse_event.y))
class MouseEvent(event, x, y, flags, param)[source]

Holds all the OpenCV mouse event information.

Key Input

class key_loop(f: Callable[[str], None])[source]

Run a function on mouse information that is received by the window, continuously in a new thread.

>>> @key_loop
... def fun(key):
...   print("key pressed:{}".format(key))