def record(button=RIGHT, target_types=(DOWN,)):
recorded = []<EOL>hook(recorded.append)<EOL>wait(button=button, target_types=target_types)<EOL>unhook(recorded.append)<EOL>return recorded<EOL>
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`.