I would like to write a program in which, when moving the mouse, the distance the pointer moves on the screen is a user defined function of the physical distance the mouse has moved on the mouse pad. The function’s initial conditions should be restored when the mouse stops. Can anyone in this group help me with an idea or an example ? Thank you all,
Peter
The wx.Window object has a WarpPointer method, which can be used to
implement what you want, but it is generally frowned upon by user interface
guidelines, and forbidden on the Mac. Happy holidays.
···
On Wed, Dec 24, 2014 at 3:07 AM, Démètre Pierre <pierre.dimo@gmail.com> wrote:
I would like to write a program in which, when moving the mouse, the
distance the pointer moves on the screen is a user defined function of the
physical distance the mouse has moved on the mouse pad. The function's
initial conditions should be restored when the mouse stops. Can anyone in
this group help me with an idea or an example ? Thank you all,
Peter
--
Best Regards,
Michael Moriarity
Démètre Pierre wrote:
I would like to write a program in which, when moving the mouse, the
distance the pointer moves on the screen is a user defined function
of the physical distance the mouse has moved on the mouse pad. The
function's initial conditions should be restored when the mouse stops.
Can anyone in this group help me with an idea or an example
The operating system already provides this ability. The mouse control
panel has a sensitivity adjustment, which does exactly what you are
describing: it allows the user to adjust the inches-to-mickeys ratio.
Doing what you are asking in a program is not easy, and is not going to
produce a good experience. The messages you get in an app don't tell
you "the mouse moved 3mm to the left". Instead, all you get is a
message giving you the new (X,Y) coordinate of the pointer. You could,
theoretically, compute the delta from the last position and then warp
the pointer appropriately, but if the mouse is moving, the motion
messages come pretty quickly. There may already be several additional
mouse movement messages queued up, and those will have been generated
assuming the old position.
···
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
Thank you for the information… but this does not solve my problem, since I want to change the “inches-to-mickeys ratio” as the mouse is moving (i.e. this ratio is calculated in a function, called within the EVT_MOTION event handler…). This would be useful in some simulation programs.
···
Le mercredi 24 décembre 2014 20:00:26 UTC+1, Tim Roberts a écrit :
Démètre Pierre wrote:
I would like to write a program in which, when moving the mouse, the
distance the pointer moves on the screen is a user defined function
of the physical distance the mouse has moved on the mouse pad. The
function’s initial conditions should be restored when the mouse stops.
Can anyone in this group help me with an idea or an example
The operating system already provides this ability. The mouse control
panel has a sensitivity adjustment, which does exactly what you are
describing: it allows the user to adjust the inches-to-mickeys ratio.
Doing what you are asking in a program is not easy, and is not going to
produce a good experience. The messages you get in an app don’t tell
you “the mouse moved 3mm to the left”. Instead, all you get is a
message giving you the new (X,Y) coordinate of the pointer. You could,
theoretically, compute the delta from the last position and then warp
the pointer appropriately, but if the mouse is moving, the motion
messages come pretty quickly. There may already be several additional
mouse movement messages queued up, and those will have been generated
assuming the old position.
–
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.
Thank you and best wishes for Christmas ! I am already using this method to position the pointer on the screen, but I need to use a function within the EVT_MOTION handler to continuously compute the pointer’s coordinates depending on mouse’s displacement.
···
Le mercredi 24 décembre 2014 19:24:51 UTC+1, Data...@gmail.com a écrit :
On Wed, Dec 24, 2014 at 3:07 AM, Démètre Pierre pierr...@gmail.com wrote:
I would like to write a program in which, when moving the mouse, the distance the pointer moves on the screen is a user defined function of the physical distance the mouse has moved on the mouse pad. The function’s initial conditions should be restored when the mouse stops. Can anyone in this group help me with an idea or an example ? Thank you all,
Peter
The wx.Window object has a WarpPointer method, which can be used to implement what you want, but it is generally frowned upon by user interface guidelines, and forbidden on the Mac. Happy holidays.
–
Best Regards,
Michael Moriarity
Démètre Pierre wrote:
Thank you for the information... but this does not solve my problem,
since I want to change the "inches-to-mickeys ratio" as the mouse is
moving (i.e. this ratio is calculated in a function, called within the
EVT_MOTION event handler...). This would be useful in some simulation
programs.
It may be useful, but you are going to find that it is simply not
possible. To do what you want, you need to hook into the mouse driver.
The application level is just too late to apply this kind of
correction. The motion has already been turned into pixels, and all you
see is the new absolute position.
Years ago, mouse drivers used to store their acceleration curves in the
registry, which adjusted the mickey ratio based on the speed of the
motion. Today, your only option is to turn acceleration on or off.
http://support.microsoft.com/kb/149228
···
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
Too bad… Anyway, thank you for answering and get my best wishes for Christmas and a for the New Year !
···
Le mercredi 24 décembre 2014 20:40:05 UTC+1, Tim Roberts a écrit :
Démètre Pierre wrote:
Thank you for the information… but this does not solve my problem,
since I want to change the “inches-to-mickeys ratio” as the mouse is
moving (i.e. this ratio is calculated in a function, called within the
EVT_MOTION event handler…). This would be useful in some simulation
programs.
It may be useful, but you are going to find that it is simply not
possible. To do what you want, you need to hook into the mouse driver.
The application level is just too late to apply this kind of
correction. The motion has already been turned into pixels, and all you
see is the new absolute position.
Years ago, mouse drivers used to store their acceleration curves in the
registry, which adjusted the mickey ratio based on the speed of the
motion. Today, your only option is to turn acceleration on or off.
[http://support.microsoft.com/kb/149228](http://support.microsoft.com/kb/149228)
–
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.