Teen Programmers Unite  
 

 

Return to forum top

Stopping Mouse Events in C

Posted by Mycroft [send private reply] at March 10, 2002, 05:08:43 PM

I have a console program where I only what the user to work with the keyboard because it is a real-time ASCII maze. But if I move the mouse events occur that screw up the program. For example everytime the character moves there is a 5% chance an enemy will attack, but if I move the mouse about 20 event occur and no matter what an enemy will attack. Is there a way to cut of the mouse from doing events to interfer with the program but still be allowed to close/minimiza/maximaze the console window.

Posted by Psion [send private reply] at March 10, 2002, 09:55:34 PM

It's your logic determining when these periodic "enemy attacks" happen. Simply skip the random calculation when the events received aren't the ones you want.

Posted by CodeRed [send private reply] at March 13, 2002, 11:46:51 AM

If your writing for the DOS console the mouse shouldn't be activated automatically anyways... Are you using the mouse in this program and activating it yourself?

You must be logged in to post messages and see which you have already read.

Log on
Username:
Password:
Save for later automatic logon

Register as a new user
 
Copyright TPU 2002. See the Credits and About TPU for more information.