Facepunch / sbox-issues

175 stars 12 forks source link

Mouse.Delta does not scale with system mouse sensitivity #3672

Closed youarereadingthis closed 1 year ago

youarereadingthis commented 1 year ago

Describe the bug

Mouse.Delta does not scale with system mouse sensitivity.

To Reproduce

Have something, like a constrained crosshair, move using Mouse.Delta.

Expected behavior

Mouse.Delta should be scaled to the system cursor sensitivity, for consistency.

Media/Files

No response

Additional context

This is a problem for my 2D shooter since we have no way of grabbing mouse delta that's consistent with the system cursor, for 1:1 aiming. Decided to use Input.MouseDelta for now but neither is that 1:1 with the system cursor.

garrynewman commented 1 year ago

Mouse.Delta should be the amount of pixels moved in that frame. In what way isn't it 1:1?

youarereadingthis commented 1 year ago

@garrynewman Mouse.Delta now appears to be fully accurate to the default system sensitivity(10 out of 20 on Windows 10).

If you change that sensitivity however it acts as if you still have the default sensitivity. I tried fully restarting sbox-dev.exe after setting my sensitivity to 20 and Mouse.Delta still acted like it was at 10.

garrynewman commented 1 year ago

This is by design, it's the number of pixels, it doesn't obey sensitivity