How to record the mouse movement until a key is pressed with Python?
问题 I want to make the function mouse.record() run until a key is pressed, rather than a mouse button. The mouse.record() is a function from the python module mouse : ( mouse/__init__.py ) def record(button=RIGHT, target_types=(DOWN,)): """ Records all mouse events until the user presses the given button. Then returns the list of events recorded. Pairs well with `play(events)`. Note: this is a blocking function. Note: for more details on the mouse hook and events see `hook`. """ recorded = []