Computing.Net > Forums > Disk Operating System > Mouse in C++

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Mouse in C++

Reply to Message Icon

Name: Tanmay Kumar
Date: June 21, 2000 at 00:09:19 Pacific
Comment:

I've written a graphical program in Turbo C++ 3.0, which calls the mouse into action using the interrupt 33H. However, the first time the mouse is moved, it leaves a small rectangle of the same colour as the background at it's original position. This does no occour again on further movement, nor on subsequent hide and show operations of the pointer. Can any one suggest some remedy? Also, how can I change the pointer, or, atlease the colour of the arrow?



Sponsored Link
Ads by Google

Response Number 1
Name: JR
Date: June 21, 2000 at 07:55:27 Pacific
Reply:

The problem is, that you have drawn something on the screen that the mouse interrupt does not know about. When it moves the pointer, it restores the background as it was when last checked or used.
That shouldn't happen if you initialize the mouse after you have drawn on the screen.
Try, first removing the mouse cursor (int 33,2) and then draw your stuff, then call int 33,0 (to reset) and then int 33,1 to show it again.
That worked for me in a program I wrote a few weeks ago. If it fails anyway, I would first try another mouse driver.

A more elegant way to do it, and more professional, is to hide the cursor, and hook the mouse IRQ (I think it's on int 74) and write your totally own procedure for drawing it.


0

Response Number 2
Name: Tanmay Kumar
Date: June 23, 2000 at 07:07:01 Pacific
Reply:

Hey, that worked!! I didn't need to get my hands dirtied with IRQs and all.

Thanks.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Mouse in C++

Problem with mouse in DOS! www.computing.net/answers/dos/problem-with-mouse-in-dos/3684.html

Can't use mouse in dos www.computing.net/answers/dos/cant-use-mouse-in-dos/9984.html

I/O port programing in c/c++ www.computing.net/answers/dos/io-port-programing-in-cc/10428.html