From: Shawn Hargreaves Newsgroups: comp.os.msdos.djgpp Subject: Re: Jumping mouse cursor Date: Thu, 15 Jan 1998 08:38:24 +0000 Organization: None Distribution: world Message-ID: <9JCcGHAAscv0EwX7@talula.demon.co.uk> References: <34BDA781 DOT 34D0 AT geocities DOT com> NNTP-Posting-Host: talula.demon.co.uk MIME-Version: 1.0 Lines: 33 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Eric Chung writes: > I am trying to write a SVGA mouse handler in DJGPP. I found >everything worked fine except when I moved the mouse cursor up and >down(vertical movement). The cursor was jumping from one point to >another instead moving and this wouldn't happen when I move the cursor >horizontally. Can you help me with that? Most mouse drivers have big problems with SVGA modes. Some work fine, others jerk in multiples of four or eight pixels (although the ones I have used tend to do the same thing along both axis, I think your vertical jumping is probably the same problem). There are various possible fixes. The simplest is to increase the mouse range and speed by a factor of eight, and divide the resulting coordinates back down before you use them to get a single pixel motion. This was the method used by Allegro versions prior to 3.0, and seems to work quite well except for on Logitech drivers which ignore the speed adjustment function (so the mouse moves very slowly with Logitech mice). To avoid this problem, in Allegro 3.0 I ditched the int 0x33 position tracking code altogether and am now only using it to read the raw mickey motion values. This turned out to be a lot easier than I was expecting, since the mickey count is available in the %si and %di parameters to the mouse movement callback, and the actual location tracking is very easy to implement from that. It is a little to early to say how reliable this method will be, but it fixes the Logitech problem and nobody has complained yet :-) If you want to see how this works in practice, look at the mouseint() function from the Allegro mouse.c file... -- Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/ "Pigs use it for a tambourine" - Frank Zappa