I'm looking for screen recording software that writes a file with the keyboard and mouse events that is easy to parse, alongside the video. The time from the key/mouse events should be synced with the video, so given a mouse click, I can find the corresponding frame in the video. So for example, the ideal software would write files video.mp4, events.json, cursor_position.json. I'm interested in all OSes.
Screenflick (OSX) seems to almost do what I want, but it saves the key/mouse data in an undocumented binary format.
In case it helps, my use case is to train a model (with machine learning) that predicts click locations during computer usage.