cant set enhanced mouse precision
Ok i still don’t have the mouse thing working. I’m trying to set the enhanced mouse position option using code. I first get the mouse settings array using systemparameterinfo, that works I get the right values in the array. I then set the last value from a 0 to a 1 to turn the setting on and vice versa to turn it off, I put that in the setmouse in systemparametersinfo with a 2 to supposedly update the mouse in the last parameter, but literally nothing happens
I have no clue why this does not work because I’m doing the same things as I find online
Only online they just use the constant for the updating, I am like 50% certain it’s 2 tho it’s super hard to actually find
Do I also have to set the registry value for this to work?
18 Replies
Anyone any idea?
@Tanner Gooding if you have time would appreciate it if you could help. Ofc it’s fine if you can’t.
can you share the code you're using and what you expect to happen?
it sounds like you're trying to turn mouse acceleration on/off
but afair, acceleration is a value between 0 and 20 with
10
being the defaulthttps://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-mouse_event describes how the thresholds and acceleration parameter work in coordination with eachother
mouse_event function (winuser.h) - Win32 apps
The mouse_event function synthesizes mouse motion and button clicks.
Yep
Well the value from 1-20 is the mouse speed which is different, you set the speed wirh set mouse speed. The actual mouse acceleration curve I can’t find how to set but it’s not with any of these functions. What I mean is the enhancement precision flag which is either true or false
the slider is the 1-20 mouse speed, the checkbox is the mouse acceleration which im trying to change
wiat
im dumb
why do i multiply
itll always be 0
that last parameter,
0x02
corresponds to SPIF_SENDCHANGE
which ensures that WM_SETTINGSCHANGE
gets sent outill feel so dumb if that fixes it
It should ye
i had a REALLY hard time finding it
but i think its 2
it's 2, it's defined in
um\WinUser.h
omg i got it working now 💀
iim so soryy this was so dumb of me
its because i multiply
so if its 0 it will always stay 0
idk why i multiplied
I believe you can set the mouse speed with
mouseInfo[2]
and SPI_SETMOUSE
as well.
That's exactly how the example given on the SystemParametersInfoW
doc page shows itletme try
SPI_SETMOUSE documents itself as
Sets the two mouse threshold values and the mouse acceleration. The pvParam parameter must point to an array of three integers that specifies these values.
well
ye mouseInfo[1] corresponds to the speed value
that is a value between 1-20
or well it is 10
mhhhm mabe it does change soemthing
i feel like it does not tho
i dont notice any difference in speed
Well, https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-mouse_event#remarks describes how acceleration works
and the example given here shows multiplying
mouseInfo[2]
, so it seems more than just 0/1
https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-systemparametersinfow#examples
I think it remains different from mouse speed itselfwell if i have speed at 20 and acceleration at 0 its faster than speed at 20 and acceleration at 1 or at 20
i am not sure
the example cant be wrong right?
it looks like acceleration acts as a scale
and that
0, 1, and 2
might be valid values
depending on how you interpret docs
If the specified distance along either the x or y axis is greater than the first mouse threshold value, and the mouse acceleration level is not zero, the operating system doubles the distance.
If the specified distance along either the x- or y-axis is greater than the second mouse threshold value, and the mouse acceleration level is equal to two, the operating system doubles the distance that resulted from applying the first threshold test
It is thus possible for the operating system to multiply relatively-specified mouse motion along the x- or y-axis by up to four times.
ah
well it atleast works how i want it to now
so thats nice