Hi! I am trying to write a program where I need to report the position of every mouse motion. I have called the XSelectInput()
function with a PointerMotionMa
Besides printing a newline at the end, you could also do a '\r'
at the end it it will move the cursor to the beginning of the existing line, so it will just print over itself each time. To make this work better, change the digit formatting to be a fixed size, like:
printf("%4d, %4d \r", event.xmotion.x, event.xmotion.y);
fflush(stdout) ;