-
You can use a port of BGI library for Windows (WinBGIm). Here’s a link to a general idea of how to do it (sample project in VS2010).
Project: http://muhammadallee.pbworks.com/w/file/53399106/WinBGIm-Demo.zip
(You would need to go to Project Properties->Linker->Input and correct the path of the lib file there.
Alternatively, use this project:
http://www.cs.colorado.edu/~main/bgi/visual/BGI2010.zip
Documentation:
http://www.cs.colorado.edu/~main/bgi/doc/ -
It will use the Windows standard mouse. So you don’t have to worry about it. You can simply set the coordinates of the mouse via
SetMousePos()
that you are using the set the coordinates of your own mouse.
Your code contains errors
Instead of
outtextxy(20, 20, "Left click " LIMIT << " times to end.");
Use this code
char msg[80] = "";
sprintf(msg, "Left click %d times to end.", LIMIT);
And comment out
triangle(maxx/divisor, maxy/divisor);
Also, download from the links that I have mentioned. After these changes, it ran fine.
PS: If it solves your problem, you can mark this as answer 🙂
3
solved how to programme an eye tracking based computer mouse in C++