From 09eeb627ab0b682c2ba300dc75cbeeae146255fc Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sun, 13 Apr 2014 03:31:55 +1000 Subject: [PATCH] Implement various build mode buttons for SpaceMouse Pro. --- linden/indra/newview/llviewerjoystick.cpp | 40 +++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/linden/indra/newview/llviewerjoystick.cpp b/linden/indra/newview/llviewerjoystick.cpp index 0490ade3..37bd9cf2 100644 --- a/linden/indra/newview/llviewerjoystick.cpp +++ b/linden/indra/newview/llviewerjoystick.cpp @@ -1053,6 +1053,46 @@ void LLViewerJoystick::scanJoystick() } } + // Check build mode buttons. + if (LLToolMgr::getInstance()->inBuildMode() && gSavedSettings.getBOOL("JoystickBuildEnabled")) + { + // No modifiers held down. + if (!mBtn[23] && !mBtn[24] && !mBtn[25]) + { + // Zoom or focus selection. + if (mBtn[1]) // FIT button + { + gViewerKeyboard.handleKey('H', MASK_SHIFT, false); + } + if (mBtn[8]) // "that other one" button. Square with an arrow around the bottom left corner. + { + gViewerKeyboard.handleKey('H', MASK_NONE, false); + } + } + + // Only CTRL held down + if (!mBtn[23] && !mBtn[24] && mBtn[25]) + { + // Edit / next / root / previous linked part. + if (mBtn[8] && !mBtnLast[8]) // "that other one" button. Square with an arrow around the bottom left corner. + { + // TODO - Edit linked parts has no keystroke. + } + if (mBtn[5] && !mBtnLast[5]) // F button + { + gViewerKeyboard.handleKey('.', MASK_CONTROL, false); + } + if (mBtn[4] && !mBtnLast[4]) // R button + { + // TODO - Select root prim doesn't even have a method call. + } + if (mBtn[2] && !mBtnLast[2]) // T button + { + gViewerKeyboard.handleKey(',', MASK_CONTROL, false); + } + } + } + if (!mOverrideCamera && !(LLToolMgr::getInstance()->inBuildMode() && gSavedSettings.getBOOL("JoystickBuildEnabled"))) { // No modifiers held down.