Re: Interesting driver modification in win2k

Posted: 11-01-2004, 01:09 PM
As you probably know mouse acceleration allows mouse pointer to cover
more space if you move the mouse faster. It is not to be confused with
mouse sensitivity. Higher sensitivity setting will make the pointer go
further regardless of the speed at witch you move the mouse. Windows
currently employs a threshold based acceleration algorithm. This means
that when you move the mouse fast enough, the mouse rate (distance per
interrupt) reaches a predetermined threshold; acceleration kicks in and
adds extra speed to the pointer. So if you move your mouse slow, it
won't accelerate, if you move it a bit faster (cross the threshold) it
will go twice as fast. Move it even faster and it will go 4x further.
This fits the description of a two-threshold acceleration algorithm
that windows use. Now, the problem with this acceleration is that the
jump from no acceleration to 2x or 4x speed is sudden and unnatural.
Hence it is not suitable for applications that require precision, such
as graphic design and games. This modification introduces a mouse accel
that is much more natural since it is calculated dynamically for each
interrupt period using the distance mouse makes in that period.
Basically, it adds mouse rate value into the equation as opposed to
fixed value in the threshold algorithm. So acceleration kicks in
instantly as soon as you move the mouse. This allows more accuracy
while maintaining the speed and there's no hard speed jumps.
Transitioning from slow to fast is smooth because acceleration is a
function of the speed at which the mouse moves. It's gradual, unlike
default accel that has only 3 states (0,2,4). The algorithm below is
similar to that of games such as Doom and Quake 3 and it's currently
used in FuhQuake QuakeWorld port.
Values:
sensitivity - mouse sensitivity multiplier
mx,my - mouse input / mouse offset on x,y axis
mouserate - rate of mouse movement - distance that mouse has travelled
during an interrupt period
acceleration_value - accel multiplier (if 0 there's no acceleration)
mouse_x,mouse_y - driver output values - mouse position after
calculating sensitivity and accel

mouserate = sqrt(mx*mx+my*my);
mouse_x = mouse_x*(mouserate * accel_value + sensitivity);
mouse_y = mouse_x*(mouserate * accel_value + sensitivity);

Pretty simple isn't it? If you know the corresponding values in the
mouse driver this modification is a piece of cake. Now you can use the
sample drivers, filter drivers from DKK or whatever you prefer to do
this. I honesty don't care how you do it as long as it _works in
games_. The very reason I need this is to be able to have the same
mouse accel in all applications including games and desktop. I'm tired
of having to switch from accelerated mouse in one game to no accel in
another just because default windows accel is no good. I've tried many
mice and drivers and many applications that feature mouse acceleration
and have found the one in Quake 3 to be the best. Of course there
should be a simple interface for settings tuning, similar to that of
regular windows driver in control panel. It should be possible to enter
accel and sensitivity values numerically and those should have at least
3 decimals. That's it. If you decide to take this task I promise you
will have the gratitude of many mouse speed junkies.

James

P.S. Almost forgot, the driver should support a 5-button USB mouse ,
like Intellimouse Explorer.
Reply With Quote

Responses to "Re: Interesting driver modification in win2k"

Maxim S. Shatskih
Guest
Posts: n/a
 
Re: Interesting driver modification in win2k
Posted: 11-01-2004, 01:25 PM
Writing a filter driver is a best idea IMHO.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com

"James" <jkowsky_CUT_@vfemail.net> wrote in message
news:%23MW0bNBwEHA.3580@TK2MSFTNGP10.phx.gbl...
> I'm looking for someone who can do a simple mouse driver modification
> for w2k using the existing driver code in w2k DKK. The goal of this
> assignment is to replace current mouse acceleration algorithm with an
> advanced one to improve mouse precision and smoothness in all
> applications, including games. This new algorithm calculates mouse
> acceleration dynamically as opposed to fixed value threshold algorithm
> that windows use. The technical side of this is not too hard and I was
> told it won't take more then an hour for an experienced driver
> developer to do. Should be an interesting assignment however,and I am
> ready to pay you a small fee for your effort, let's say 20$. That's a
> decent hourly pay I think .
>
> (Go to next post for detailed description)

Reply With Quote
Doron Holan [MS]
Guest
Posts: n/a
 
Re: Interesting driver modification in win2k
Posted: 11-01-2004, 04:09 PM
a filter driver would work here....BUT windows acceleration algorithm is
applied at a higher level in USER (in the raw input thread) after all the
different mouse streams have been merged into one stream. If you can turn
off window's accleration algorithm (don't know how to do that), you can
implement the algorithm on a per mouse basis in your filter.

As for supporting a 5 button vs any other mouse, as a filter, it doesn't
matter. you sit on top of the device and modify its X and Y deltas and
leave the other data alone.

d
--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message
news:%233Fp0YBwEHA.3624@TK2MSFTNGP09.phx.gbl...
> Writing a filter driver is a best idea IMHO.
>
> --
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> maxim@storagecraft.com
> http://www.storagecraft.com
>
> "James" <jkowsky_CUT_@vfemail.net> wrote in message
> news:%23MW0bNBwEHA.3580@TK2MSFTNGP10.phx.gbl...
>> I'm looking for someone who can do a simple mouse driver modification
>> for w2k using the existing driver code in w2k DKK. The goal of this
>> assignment is to replace current mouse acceleration algorithm with an
>> advanced one to improve mouse precision and smoothness in all
>> applications, including games. This new algorithm calculates mouse
>> acceleration dynamically as opposed to fixed value threshold algorithm
>> that windows use. The technical side of this is not too hard and I was
>> told it won't take more then an hour for an experienced driver
>> developer to do. Should be an interesting assignment however,and I am
>> ready to pay you a small fee for your effort, let's say 20$. That's a
>> decent hourly pay I think .
>>
>> (Go to next post for detailed description)
>
>

Reply With Quote
Robert Marquardt
Guest
Posts: n/a
 
Re: Interesting driver modification in win2k
Posted: 11-01-2004, 04:42 PM
Doron Holan [MS] wrote:
> If you can turn
> off window's accleration algorithm (don't know how to do that), you can
> implement the algorithm on a per mouse basis in your filter.
SystemParametersInfo() parameter SPI_GETMOUSE and SPI_SETMOUSE
Reply With Quote
Ray Trent
Guest
Posts: n/a
 
Re: Interesting driver modification in win2k
Posted: 11-01-2004, 06:22 PM
I'll also point out that on WinXP, they have already put in place a
vastly more sophisticated algorithm. See:
http://www.microsoft.com/whdc/device...inter-bal.mspx

On any OS, though, the basic problem for a mouse filter driver is that
the ballistics aren't something you can really turn off unless you're
prepared to filter *every* mouse device. Unfortunately, you can't do
this, because ordinary applications can effectively be "mouse devices"
by calling SendInput, and there's no way to filter that (at least
without patching the OS or some other hideousness).

This problem is quite hard to solve in general. You're left "undoing"
the ballistics that will be applied at a higher level, which means you
have to monitor what they are via a user-mode app. On pre-XP OS's, it
also means that you have to create duplicate packets, because some
numbers of pixels of motion aren't accessible through the filter with a
single packet (think about how you'd generate motion of magnitude
"first-mouse-threshold plus one"). In XP, the ballistics algorithm is
sufficiently complex that it would take a moderate-size research project
to figure out how to undo them (assuming it's even possible).

Here's an interesting quirk of the XP ballistics algorithm, BTW: mouse
speed is linearly related to the *screen refresh rate*. So a mouse is
~20% slower on a typical 60Hz laptop display than it is on a typical
85Hz desktop display *of the same size and resolution*.

In case you doubt this, I have a simple little test program that
verifies that this is indeed the case. The claim is that lower refresh
rates make pointer motion less "smooth", and that, as a result, ideal
controllability requires slower motion. I'm dubious (but open-minded...
human factors testing suggests that there may be such an effect, but I
suspect it is far smaller than the compensation being applied).

Doron Holan [MS] wrote:
> a filter driver would work here....BUT windows acceleration algorithm is
> applied at a higher level in USER (in the raw input thread) after all the
> different mouse streams have been merged into one stream. If you can turn
> off window's accleration algorithm (don't know how to do that), you can
> implement the algorithm on a per mouse basis in your filter.
>
> As for supporting a 5 button vs any other mouse, as a filter, it doesn't
> matter. you sit on top of the device and modify its X and Y deltas and
> leave the other data alone.
>
> d
--
.../ray\..
Reply With Quote
 
LinkBack Thread Tools Display Modes
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
Interesting problem Dave A Windows Vista Performance & Maintenance 0 03-14-2007 01:10 PM
messenger.msi modification? Martin Windows XP Messenger 0 08-27-2003 07:02 PM
XP Pro client joins Win2K domain faster than Win2K Pro client Michelle Windows XP Security & Administration 1 07-08-2003 10:35 PM