cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Clicking and console
Clicking and console
Mar 6, 2012 at 11:59am UTC
tofiffe
(139)
I've seen some apps made in console, that used mouse clicks.
How could I do that in my console app? Is there any simple code just to get the x/y coordinate of mouse click when it happens?
Mar 6, 2012 at 12:03pm UTC
Peter87
(11254)
This is not possible with standard C++ functions. You need to use a library like ncurses to do it.
Mar 6, 2012 at 1:31pm UTC
Pravesh Koirala
(267)
You can use windows API (if you are in windows). You can use this,
http://theprogrammersdiary.blogspot.com/2011/12/mouse-handling-in-console-console-is.html
Mar 6, 2012 at 8:22pm UTC
tofiffe
(139)
well thanks for this c example, but isn't there a simpler way to achieve the same? Oh and i forgot to mention, it only needs to run on windows, so if anyone knows some platform based solution, please go ahead!
Mar 6, 2012 at 9:01pm UTC
Moschops
(7244)
That is an astonishingly simple windows based solution.
Mar 6, 2012 at 9:24pm UTC
tofiffe
(139)
ok, thanks for letting me know!
Topic archived. No new replies allowed.