diff options
author | Lynx Linden <lynx@lindenlab.com> | 2010-01-29 10:27:15 +0000 |
---|---|---|
committer | Lynx Linden <lynx@lindenlab.com> | 2010-01-29 10:27:15 +0000 |
commit | 540752ff2dcaaf565e8a9dff93079816ef572312 (patch) | |
tree | b7199a2f8ca4cca71c5810d50d946a0814280d3e /indra | |
parent | 9a4d075f3b8ab1ccf760187beeb81f9bf17e69b1 (diff) |
DEV-41686: Added a DisableMouseWarp debug option.
Turning this option on makes alt-zooming and mouselook actually work
when using Synergy. I believe this will also make it work for certain
input devices, and Parallels, that control your cursor by setting its
position in absolute coordinates.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/app_settings/settings.xml | 11 | ||||
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 17 |
2 files changed, 21 insertions, 7 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 1ef79aeec0..f3bda19ed1 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -2377,6 +2377,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>DisableMouseWarp</key> + <map> + <key>Comment</key> + <string>Disable warping of the mouse to the center of the screen during alt-zoom and mouse look. Useful with certain input devices, mouse sharing programs like Synergy, or running under Parallels.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>DisableRendering</key> <map> <key>Comment</key> diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index b4c73dba26..8692cdcc57 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2269,15 +2269,18 @@ void LLViewerWindow::handleScrollWheel(S32 clicks) void LLViewerWindow::moveCursorToCenter() { - S32 x = getWorldViewWidthScaled() / 2; - S32 y = getWorldViewHeightScaled() / 2; + if (! gSavedSettings.getBOOL("DisableMouseWarp")) + { + S32 x = getWorldViewWidthScaled() / 2; + S32 y = getWorldViewHeightScaled() / 2; - //on a forced move, all deltas get zeroed out to prevent jumping - mCurrentMousePoint.set(x,y); - mLastMousePoint.set(x,y); - mCurrentMouseDelta.set(0,0); + //on a forced move, all deltas get zeroed out to prevent jumping + mCurrentMousePoint.set(x,y); + mLastMousePoint.set(x,y); + mCurrentMouseDelta.set(0,0); - LLUI::setMousePositionScreen(x, y); + LLUI::setMousePositionScreen(x, y); + } } |