Initial position
add_cursor()
only adds the cursor's position to the function's queue if there is a change.
Depending on needs, I'd expect the initial mouse position to be added too and not assume it is {0,0}. Presently, the true initial mouse position is never saved.
Suggest:
POINT cursor_buff[2] = { get_cursor(), { 0,0}};
add_function(head, tail, _GETCURSOR, cursor_buff[0].x, cursor_buff[0].y);
while(key_buff[1] != KEY_W) {
....
Backwards?
play_recording()
looks like tail = tail->prev;
is playing back in reverse order. I'd expect re-play to start at the beginning and play use tail = tail->prev;>next
does not well imply a queue.
Need to see add_function()
.