I am doveloping a game brain champ. This is its version 3. In this version I want to use mouse in addition with keyboard for input. I have successfully tested its standalone keyboard version as well as mouse version. I have used int86() function for mouse with 0x33 interrupt number. Also I have used getch() function for keyboard input. But my main problem is I m not able to use mouse and keyboard simultaneously. As when I do so getch() holds the program and thus I can't get mouse input simultaneously. Please help me out. I am working on turbo c++ 3.0. I am an experienced programmer. Please give me sample code so that I can use it accordingly. Thanks in advance.
sanyam.mishra
-1
Newbie Poster
Recommended Answers
Jump to PostBefore calling getch() find out if anything is in the keyboard buffer kbhit() from conio.h will tell you that. If nothing there then you can check for mouse input.
Jump to Postfflush is not supposed to work with stdin -- it's only for output streams like stdout. You can write your own fflush like this
void flushKeyboard() { while( kbhit() ) getch(); }
All 8 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
sanyam.mishra
-1
Newbie Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
sanyam.mishra
-1
Newbie Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
sanyam.mishra
-1
Newbie Poster
paul.stevin
0
Newbie Poster
sanyam.mishra
-1
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.