pynput is the library allows you to control and monitor input devices.

Currently, mouse and keyboard input and monitoring are supported.
