This Python program records the mouse and some keyboard movements. The recorded macros can be saved or played directly. I use Tkinter as user interface and pynput for recording and playback. To start the program the rec.py file must be executed. The rep.py can be included in other projects, it can play the saved recordings.
I have tested the program only on Windows.