Question: I need help with my c mouse position code so that it works properly. The mouse position is supposed to update when you move it
I need help with my c mouse position code so that it works properly. The mouse position is supposed to update when you move it and should keep updating the position as you move. The mouse left and right button clicked works but whenever I move the mouse it just keeps outputing the same position. How can I fix this.
I already compiled the code with lxdo lX at the end, and I run the code with sudo
#include
#include
#include
#include
#include
#include
int main
char info;
int devmouse ;
devmouse opendevinputmice ORDWR;
while
readdevmouse, info, ;
if x & info printfs "left button down
;
if x & info printfs "right button down
;
Read in positions of your mouse and print them;
int x y scrn;
xdot handle xdonewNULL;
xdogetmouselocationhandle &x &y &scrn;
xdofreehandle;
printfMouse Position: x d y d
x y;
closedevmouse;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
