diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2022-07-12 00:42:54 +0300 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2022-07-12 00:42:54 +0300 |
commit | 43de9f202e9c09bc46e9b4e51ac87425b99b9a55 (patch) | |
tree | 99ea03d6f0af12135b4a428ec0b7c595a7d3ee9f /indra/llwindow/llwindowwin32.cpp | |
parent | 3f98411c56f4daa06c9102346a8dd37af18d2cb6 (diff) | |
parent | 1e4f2ec07e32a142f35817d3186a124df3f8cd25 (diff) |
Merge branch 'master' into DRTVWR-528
# Conflicts:
# indra/newview/llappviewer.cpp
Diffstat (limited to 'indra/llwindow/llwindowwin32.cpp')
-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); + } } } } |