diff options
author | Mnikolenko Productengine <mnikolenko@productengine.com> | 2022-06-03 14:08:04 +0300 |
---|---|---|
committer | Mnikolenko Productengine <mnikolenko@productengine.com> | 2022-06-03 14:08:04 +0300 |
commit | ff65e23f2097d4cca524d58b4fa2ab839184ee27 (patch) | |
tree | c4100f89e10c21492c78ed4a54178114fbeeb7af /indra | |
parent | 90e8cc630d5ce1332b183bf4232c368d385b8f01 (diff) |
SL-17515 FIXED Extreme Mouse Sensitivity for Certain Actions
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llwindow/llwindowwin32.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 1f3823509c..4c3aeb4695 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -3057,8 +3057,20 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ if (raw->header.dwType == RIM_TYPEMOUSE) { LLMutexLock lock(&window_imp->mRawMouseMutex); - window_imp->mRawMouseDelta.mX += raw->data.mouse.lLastX; - window_imp->mRawMouseDelta.mY -= raw->data.mouse.lLastY; + + S32 speed; + const S32 DEFAULT_SPEED(10); + SystemParametersInfo(SPI_GETMOUSESPEED, 0, &speed, 0); + if (speed == DEFAULT_SPEED) + { + window_imp->mRawMouseDelta.mX += raw->data.mouse.lLastX; + window_imp->mRawMouseDelta.mY -= raw->data.mouse.lLastY; + } + else + { + window_imp->mRawMouseDelta.mX += round((F32)raw->data.mouse.lLastX * (F32)speed / DEFAULT_SPEED); + window_imp->mRawMouseDelta.mY -= round((F32)raw->data.mouse.lLastY * (F32)speed / DEFAULT_SPEED); + } } } } |