From b12cf6696348520556cf70f96e0562776479fe70 Mon Sep 17 00:00:00 2001
From: andreykproductengine <andreykproductengine@lindenlab.com>
Date: Fri, 27 Sep 2019 15:25:47 +0300
Subject: [PATCH] SL-6109 Small reorganisation

---
 indra/newview/CMakeLists.txt                  |  4 +-
 indra/newview/llappviewer.cpp                 |  8 +--
 indra/newview/llkeyconflict.cpp               | 20 ++++----
 indra/newview/llkeyconflict.h                 |  4 +-
 ...llviewerkeyboard.cpp => llviewerinput.cpp} | 51 +++++++++----------
 .../{llviewerkeyboard.h => llviewerinput.h}   | 22 ++++----
 indra/newview/llviewerwindow.cpp              | 30 +++++------
 indra/newview/llwindowlistener.cpp            |  6 +--
 .../xui/en/panel_preferences_controls.xml     |  5 +-
 9 files changed, 73 insertions(+), 77 deletions(-)
 rename indra/newview/{llviewerkeyboard.cpp => llviewerinput.cpp} (95%)
 rename indra/newview/{llviewerkeyboard.h => llviewerinput.h} (92%)

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 340af8ece0a..41f455d63a6 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -662,7 +662,7 @@ set(viewer_SOURCE_FILES
     llviewerjointattachment.cpp
     llviewerjointmesh.cpp
     llviewerjoystick.cpp
-    llviewerkeyboard.cpp
+    llviewerinput.cpp
     llviewerlayer.cpp
     llviewermedia.cpp
     llviewermedia_streamingaudio.cpp
@@ -1286,7 +1286,7 @@ set(viewer_HEADER_FILES
     llviewerjointattachment.h
     llviewerjointmesh.h
     llviewerjoystick.h
-    llviewerkeyboard.h
+    llviewerinput.h
     llviewerlayer.h
     llviewermedia.h
     llviewermediafocus.h
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 06deed9e589..7145f0f29c7 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -149,7 +149,7 @@
 #include "llapr.h"
 #include <boost/lexical_cast.hpp>
 
-#include "llviewerkeyboard.h"
+#include "llviewerinput.h"
 #include "lllfsthread.h"
 #include "llworkerthread.h"
 #include "lltexturecache.h"
@@ -1004,11 +1004,11 @@ bool LLAppViewer::init()
 
 	// Load User's bindings
 	std::string key_bindings_file = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "keys.xml");
-	if (!gDirUtilp->fileExists(key_bindings_file) || !gViewerKeyboard.loadBindingsXML(key_bindings_file))
+	if (!gDirUtilp->fileExists(key_bindings_file) || !gViewerInput.loadBindingsXML(key_bindings_file))
 	{
 		// Failed to load custom bindings, try default ones
 		key_bindings_file = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "keys.xml");
-		if (!gViewerKeyboard.loadBindingsXML(key_bindings_file))
+		if (!gViewerInput.loadBindingsXML(key_bindings_file))
 		{
 			LL_ERRS("InitInfo") << "Unable to open default key bindings from" << key_bindings_file << LL_ENDL;
 		}
@@ -1442,7 +1442,7 @@ bool LLAppViewer::doFrame()
 			{
 				joystick->scanJoystick();
 				gKeyboard->scanKeyboard();
-                gViewerKeyboard.scanMouse();
+                gViewerInput.scanMouse();
 			}
 
 			// Update state based on messages, user input, object idle.
diff --git a/indra/newview/llkeyconflict.cpp b/indra/newview/llkeyconflict.cpp
index 66d420369ea..e81d121e3bb 100644
--- a/indra/newview/llkeyconflict.cpp
+++ b/indra/newview/llkeyconflict.cpp
@@ -37,7 +37,7 @@
 #include "llinitparam.h"
 #include "llkeyboard.h"
 #include "llviewercontrol.h"
-#include "llviewerkeyboard.h"
+#include "llviewerinput.h"
 #include "llxuiparser.h"
 //#include "llstring.h"
 
@@ -117,7 +117,7 @@ static const std::string typetostring[LLKeyConflictHandler::CONTROL_NUM_INDICES]
     "control_cntrl_select"
 };
 
-// note, a solution is needed that will keep this up to date with llviewerkeyboard
+// note, a solution is needed that will keep this up to date with llviewerinput
 typedef std::map<std::string, LLKeyConflictHandler::EControlTypes> control_enum_t;
 static const control_enum_t command_to_key =
 {
@@ -358,9 +358,9 @@ std::string LLKeyConflictHandler::getControlString(EControlTypes control_type, U
     return getStringFromKeyData(mControlsMap[control_type].getKeyData(index));
 }
 
-void  LLKeyConflictHandler::loadFromSettings(const LLViewerKeyboard::KeyMode& keymode, control_map_t *destination)
+void  LLKeyConflictHandler::loadFromSettings(const LLViewerInput::KeyMode& keymode, control_map_t *destination)
 {
-    for (LLInitParam::ParamIterator<LLViewerKeyboard::KeyBinding>::const_iterator it = keymode.bindings.begin(),
+    for (LLInitParam::ParamIterator<LLViewerInput::KeyBinding>::const_iterator it = keymode.bindings.begin(),
         end_it = keymode.bindings.end();
         it != end_it;
     ++it)
@@ -400,7 +400,7 @@ void LLKeyConflictHandler::loadFromSettings(const ESourceMode &load_mode, const
         return;
     }
 
-    LLViewerKeyboard::Keys keys;
+    LLViewerInput::Keys keys;
     LLSimpleXUIParser parser;
 
     if (parser.readXUI(filename, keys)
@@ -556,7 +556,7 @@ void  LLKeyConflictHandler::saveToSettings()
             gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, ""),
             gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, ""));
 
-        LLViewerKeyboard::Keys keys;
+        LLViewerInput::Keys keys;
         LLSimpleXUIParser parser;
 
         if (parser.readXUI(filename, keys)
@@ -566,8 +566,8 @@ void  LLKeyConflictHandler::saveToSettings()
 
             // todo: fix this
             // workaround to avoid doing own param container 
-            LLViewerKeyboard::KeyMode mode;
-            LLViewerKeyboard::KeyBinding binding;
+            LLViewerInput::KeyMode mode;
+            LLViewerInput::KeyBinding binding;
 
             control_map_t::iterator iter = mControlsMap.begin();
             control_map_t::iterator end = mControlsMap.end();
@@ -657,7 +657,7 @@ void  LLKeyConflictHandler::saveToSettings()
             // Now force a rebind for keyboard
             if (gDirUtilp->fileExists(filename))
             {
-                gViewerKeyboard.loadBindingsXML(filename);
+                gViewerInput.loadBindingsXML(filename);
             }
         }
     }
@@ -816,7 +816,7 @@ void LLKeyConflictHandler::resetKeyboardBindings()
         gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, ""),
         gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, ""));
     
-    gViewerKeyboard.loadBindingsXML(filename);
+    gViewerInput.loadBindingsXML(filename);
 }
 
 void LLKeyConflictHandler::generatePlaceholders(ESourceMode load_mode)
diff --git a/indra/newview/llkeyconflict.h b/indra/newview/llkeyconflict.h
index 00fbe18863d..e4a6da30d0e 100644
--- a/indra/newview/llkeyconflict.h
+++ b/indra/newview/llkeyconflict.h
@@ -28,7 +28,7 @@
 #define LL_LLKEYCONFLICT_H
 
 #include "llkeybind.h"
-#include "llviewerkeyboard.h"
+#include "llviewerinput.h"
 
 
 class LLKeyConflict
@@ -195,7 +195,7 @@ class LLKeyConflictHandler
     void registerTemporaryControl(EControlTypes control_type, EMouseClickType mouse_ind, KEY key, MASK mask, U32 conflict_mask);
 
     typedef std::map<EControlTypes, LLKeyConflict> control_map_t;
-    void loadFromSettings(const LLViewerKeyboard::KeyMode& keymode, control_map_t *destination);
+    void loadFromSettings(const LLViewerInput::KeyMode& keymode, control_map_t *destination);
     void loadFromSettings(const ESourceMode &load_mode, const std::string &filename, control_map_t *destination);
     void resetKeyboardBindings();
     void generatePlaceholders(ESourceMode load_mode); //E.x. non-assignable values
diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerinput.cpp
similarity index 95%
rename from indra/newview/llviewerkeyboard.cpp
rename to indra/newview/llviewerinput.cpp
index 2647abc74ca..fb405fd2250 100644
--- a/indra/newview/llviewerkeyboard.cpp
+++ b/indra/newview/llviewerinput.cpp
@@ -1,6 +1,6 @@
 /** 
- * @file llviewerkeyboard.cpp
- * @brief LLViewerKeyboard class implementation
+ * @file llviewerinput.cpp
+ * @brief LLViewerInput class implementation
  *
  * $LicenseInfo:firstyear=2005&license=viewerlgpl$
  * Second Life Viewer Source Code
@@ -26,7 +26,7 @@
 
 #include "llviewerprecompiledheaders.h"
 
-#include "llviewerkeyboard.h"
+#include "llviewerinput.h"
 
 #include "llappviewer.h"
 #include "llfloaterreg.h"
@@ -65,7 +65,7 @@ struct LLKeyboardActionRegistry
 	LLSINGLETON_EMPTY_CTOR(LLKeyboardActionRegistry);
 };
 
-LLViewerKeyboard gViewerKeyboard;
+LLViewerInput gViewerInput;
 
 bool agent_jump( EKeystate s )
 {
@@ -469,7 +469,6 @@ bool camera_move_forward_sitting( EKeystate s )
 	return true;
 }
 
-
 bool camera_move_backward_sitting( EKeystate s )
 {
 	if( KEYSTATE_UP == s && gAgent.mDoubleTapRunMode != LLAgent::DOUBLETAP_BACKWARD ) return true;
@@ -802,7 +801,7 @@ REGISTER_KEYBOARD_ACTION("toggle_voice", toggle_voice);
 REGISTER_KEYBOARD_ACTION("voice_follow_key", voice_follow_key);
 #undef REGISTER_KEYBOARD_ACTION
 
-LLViewerKeyboard::LLViewerKeyboard()
+LLViewerInput::LLViewerInput()
 {
     resetBindings();
 
@@ -821,7 +820,7 @@ LLViewerKeyboard::LLViewerKeyboard()
 	}
 }
 
-BOOL LLViewerKeyboard::modeFromString(const std::string& string, S32 *mode) const
+BOOL LLViewerInput::modeFromString(const std::string& string, S32 *mode) const
 {
 	if (string == "FIRST_PERSON")
 	{
@@ -855,7 +854,7 @@ BOOL LLViewerKeyboard::modeFromString(const std::string& string, S32 *mode) cons
 	}
 }
 
-BOOL LLViewerKeyboard::mouseFromString(const std::string& string, EMouseClickType *mode) const
+BOOL LLViewerInput::mouseFromString(const std::string& string, EMouseClickType *mode) const
 {
     if (string == "LMB")
     {
@@ -889,10 +888,10 @@ BOOL LLViewerKeyboard::mouseFromString(const std::string& string, EMouseClickTyp
     }
 }
 
-BOOL LLViewerKeyboard::handleKey(KEY translated_key,  MASK translated_mask, BOOL repeated)
+BOOL LLViewerInput::handleKey(KEY translated_key, MASK translated_mask, BOOL repeated)
 {
 	// check for re-map
-	EKeyboardMode mode = gViewerKeyboard.getMode();
+	EKeyboardMode mode = gViewerInput.getMode();
 	U32 keyidx = (translated_mask<<16) | translated_key;
 	key_remap_t::iterator iter = mRemapKeys[mode].find(keyidx);
 	if (iter != mRemapKeys[mode].end())
@@ -927,12 +926,12 @@ BOOL LLViewerKeyboard::handleKey(KEY translated_key,  MASK translated_mask, BOOL
 	return mKeyHandledByUI[translated_key];
 }
 
-BOOL LLViewerKeyboard::handleKeyUp(KEY translated_key, MASK translated_mask)
+BOOL LLViewerInput::handleKeyUp(KEY translated_key, MASK translated_mask)
 {
 	return gViewerWindow->handleKeyUp(translated_key, translated_mask);
 }
 
-BOOL LLViewerKeyboard::bindKey(const S32 mode, const KEY key, const MASK mask, const bool ignore, const std::string& function_name)
+BOOL LLViewerInput::bindKey(const S32 mode, const KEY key, const MASK mask, const bool ignore, const std::string& function_name)
 {
 	S32 index;
 	typedef boost::function<bool(EKeystate)> function_t;
@@ -1023,7 +1022,7 @@ BOOL LLViewerKeyboard::bindKey(const S32 mode, const KEY key, const MASK mask, c
 	return TRUE;
 }
 
-BOOL LLViewerKeyboard::bindMouse(const S32 mode, const EMouseClickType mouse, const MASK mask, const bool ignore, const std::string& function_name)
+BOOL LLViewerInput::bindMouse(const S32 mode, const EMouseClickType mouse, const MASK mask, const bool ignore, const std::string& function_name)
 {
     S32 index;
     typedef boost::function<bool(EKeystate)> function_t;
@@ -1092,7 +1091,7 @@ BOOL LLViewerKeyboard::bindMouse(const S32 mode, const EMouseClickType mouse, co
     return TRUE;
 }
 
-LLViewerKeyboard::KeyBinding::KeyBinding()
+LLViewerInput::KeyBinding::KeyBinding()
 :	key("key"),
 	mouse("mouse"),
 	mask("mask"),
@@ -1100,11 +1099,11 @@ LLViewerKeyboard::KeyBinding::KeyBinding()
 	ignore("ignore", false)
 {}
 
-LLViewerKeyboard::KeyMode::KeyMode()
+LLViewerInput::KeyMode::KeyMode()
 :	bindings("binding")
 {}
 
-LLViewerKeyboard::Keys::Keys()
+LLViewerInput::Keys::Keys()
 :	first_person("first_person"),
 	third_person("third_person"),
 	edit("edit"),
@@ -1112,7 +1111,7 @@ LLViewerKeyboard::Keys::Keys()
 	edit_avatar("edit_avatar")
 {}
 
-void LLViewerKeyboard::resetBindings()
+void LLViewerInput::resetBindings()
 {
     for (S32 i = 0; i < MODE_COUNT; i++)
     {
@@ -1123,7 +1122,7 @@ void LLViewerKeyboard::resetBindings()
     }
 }
 
-S32 LLViewerKeyboard::loadBindingsXML(const std::string& filename)
+S32 LLViewerInput::loadBindingsXML(const std::string& filename)
 {
     resetBindings();
 
@@ -1143,7 +1142,7 @@ S32 LLViewerKeyboard::loadBindingsXML(const std::string& filename)
 	return binding_count;
 }
 
-S32 LLViewerKeyboard::loadBindingMode(const LLViewerKeyboard::KeyMode& keymode, S32 mode)
+S32 LLViewerInput::loadBindingMode(const LLViewerInput::KeyMode& keymode, S32 mode)
 {
 	S32 binding_count = 0;
 	for (LLInitParam::ParamIterator<KeyBinding>::const_iterator it = keymode.bindings.begin(), 
@@ -1196,7 +1195,7 @@ S32 LLViewerKeyboard::loadBindingMode(const LLViewerKeyboard::KeyMode& keymode,
 	return binding_count;
 }
 
-EKeyboardMode LLViewerKeyboard::getMode() const
+EKeyboardMode LLViewerInput::getMode() const
 {
 	if ( gAgentCamera.cameraMouselook() )
 	{
@@ -1216,7 +1215,7 @@ EKeyboardMode LLViewerKeyboard::getMode() const
 	}
 }
 
-bool LLViewerKeyboard::scanKey(const LLKeyboardBinding* binding,
+bool LLViewerInput::scanKey(const LLKeyboardBinding* binding,
                                S32 binding_count,
                                KEY key,
                                MASK mask,
@@ -1258,7 +1257,7 @@ bool LLViewerKeyboard::scanKey(const LLKeyboardBinding* binding,
 }
 
 // Called from scanKeyboard.
-bool LLViewerKeyboard::scanKey(KEY key, BOOL key_down, BOOL key_up, BOOL key_level) const
+bool LLViewerInput::scanKey(KEY key, BOOL key_down, BOOL key_up, BOOL key_level) const
 {
 	if (LLApp::isExiting())
 	{
@@ -1298,7 +1297,7 @@ bool LLViewerKeyboard::scanKey(KEY key, BOOL key_down, BOOL key_up, BOOL key_lev
     return res;
 }
 
-BOOL LLViewerKeyboard::handleMouse(LLWindow *window_impl, LLCoordGL pos, MASK mask, EMouseClickType clicktype, BOOL down)
+BOOL LLViewerInput::handleMouse(LLWindow *window_impl, LLCoordGL pos, MASK mask, EMouseClickType clicktype, BOOL down)
 {
     BOOL handled = gViewerWindow->handleAnyMouseClick(window_impl, pos, mask, clicktype, down);
 
@@ -1370,7 +1369,7 @@ BOOL LLViewerKeyboard::handleMouse(LLWindow *window_impl, LLCoordGL pos, MASK ma
     return handled;
 }
 
-bool LLViewerKeyboard::scanMouse(const LLMouseBinding *binding, S32 binding_count, EMouseClickType mouse, MASK mask, EMouseState state) const
+bool LLViewerInput::scanMouse(const LLMouseBinding *binding, S32 binding_count, EMouseClickType mouse, MASK mask, EMouseState state) const
 {
     for (S32 i = 0; i < binding_count; i++)
     {
@@ -1406,7 +1405,7 @@ bool LLViewerKeyboard::scanMouse(const LLMouseBinding *binding, S32 binding_coun
 }
 
 // todo: this recods key, scanMouse() triggers functions with EKeystate
-bool LLViewerKeyboard::scanMouse(EMouseClickType click, EMouseState state) const
+bool LLViewerInput::scanMouse(EMouseClickType click, EMouseState state) const
 {
     bool res = false;
     S32 mode = getMode();
@@ -1443,7 +1442,7 @@ bool LLViewerKeyboard::scanMouse(EMouseClickType click, EMouseState state) const
     return res;
 }
 
-void LLViewerKeyboard::scanMouse()
+void LLViewerInput::scanMouse()
 {
     for (S32 i = 0; i < CLICK_COUNT; i++)
     {
diff --git a/indra/newview/llviewerkeyboard.h b/indra/newview/llviewerinput.h
similarity index 92%
rename from indra/newview/llviewerkeyboard.h
rename to indra/newview/llviewerinput.h
index 02fa21d4f24..d18a61eaf0f 100644
--- a/indra/newview/llviewerkeyboard.h
+++ b/indra/newview/llviewerinput.h
@@ -1,6 +1,6 @@
 /** 
- * @file llviewerkeyboard.h
- * @brief LLViewerKeyboard class header file
+ * @file llviewerinput.h
+ * @brief LLViewerInput class header file
  *
  * $LicenseInfo:firstyear=2005&license=viewerlgpl$
  * Second Life Viewer Source Code
@@ -24,8 +24,8 @@
  * $/LicenseInfo$
  */
 
-#ifndef LL_LLVIEWERKEYBOARD_H
-#define LL_LLVIEWERKEYBOARD_H
+#ifndef LL_LLVIEWERINPUT_H
+#define LL_LLVIEWERINPUT_H
 
 #include "llkeyboard.h" // For EKeystate
 #include "llinitparam.h"
@@ -78,7 +78,7 @@ class LLWindow;
 
 void bind_keyboard_functions();
 
-class LLViewerKeyboard
+class LLViewerInput
 {
 public:
 	struct KeyBinding : public LLInitParam::Block<KeyBinding>
@@ -110,7 +110,7 @@ class LLViewerKeyboard
 		Keys();
 	};
 
-	LLViewerKeyboard();
+	LLViewerInput();
 
 	BOOL			handleKey(KEY key, MASK mask, BOOL repeated);
 	BOOL			handleKeyUp(KEY key, MASK mask);
@@ -127,8 +127,8 @@ class LLViewerKeyboard
                             BOOL key_level) const;
 
     // handleMouse() records state, scanMouse() goes through states, scanMouse(click) processes individual saved states after UI is done with them
-    BOOL			handleMouse(LLWindow *window_impl, LLCoordGL pos, MASK mask, EMouseClickType clicktype, BOOL down);
-	void LLViewerKeyboard::scanMouse();
+    BOOL            handleMouse(LLWindow *window_impl, LLCoordGL pos, MASK mask, EMouseClickType clicktype, BOOL down);
+    void            scanMouse();
 
 private:
     bool            scanKey(const LLKeyboardBinding* binding,
@@ -155,7 +155,7 @@ class LLViewerKeyboard
                           MASK mask,
                           EMouseState state) const;
 
-    S32				loadBindingMode(const LLViewerKeyboard::KeyMode& keymode, S32 mode);
+    S32				loadBindingMode(const LLViewerInput::KeyMode& keymode, S32 mode);
     BOOL			bindKey(const S32 mode, const KEY key, const MASK mask, const bool ignore, const std::string& function_name);
     BOOL			bindMouse(const S32 mode, const EMouseClickType mouse, const MASK mask, const bool ignore, const std::string& function_name);
     void			resetBindings();
@@ -188,6 +188,6 @@ class LLViewerKeyboard
     EMouseState		mMouseLevel[CLICK_COUNT];	// records of key state
 };
 
-extern LLViewerKeyboard gViewerKeyboard;
+extern LLViewerInput gViewerInput;
 
-#endif // LL_LLVIEWERKEYBOARD_H
+#endif // LL_LLVIEWERINPUT_H
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 77ae85e7f68..28adc2b7ab6 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -45,7 +45,7 @@
 #include "llmeshrepository.h"
 #include "llnotificationhandler.h"
 #include "llpanellogin.h"
-#include "llviewerkeyboard.h"
+#include "llviewerinput.h"
 #include "llviewermenu.h"
 
 #include "llviewquery.h"
@@ -173,7 +173,7 @@
 #include "llviewergesture.h"
 #include "llviewertexturelist.h"
 #include "llviewerinventory.h"
-#include "llviewerkeyboard.h"
+#include "llviewerinput.h"
 #include "llviewermedia.h"
 #include "llviewermediafocus.h"
 #include "llviewermenu.h"
@@ -1097,7 +1097,7 @@ BOOL LLViewerWindow::handleMouseDown(LLWindow *window,  LLCoordGL pos, MASK mask
     }    
     BOOL down = TRUE;
     //handleMouse() loops back to LLViewerWindow::handleAnyMouseClick
-    return gViewerKeyboard.handleMouse(window, pos, mask, CLICK_LEFT, down);
+    return gViewerInput.handleMouse(window, pos, mask, CLICK_LEFT, down);
 }
 
 BOOL LLViewerWindow::handleDoubleClick(LLWindow *window,  LLCoordGL pos, MASK mask)
@@ -1105,7 +1105,7 @@ BOOL LLViewerWindow::handleDoubleClick(LLWindow *window,  LLCoordGL pos, MASK ma
 	// try handling as a double-click first, then a single-click if that
 	// wasn't handled.
 	BOOL down = TRUE;
-	if (gViewerKeyboard.handleMouse(window, pos, mask, CLICK_DOUBLELEFT, down))
+	if (gViewerInput.handleMouse(window, pos, mask, CLICK_DOUBLELEFT, down))
 	{
 		return TRUE;
 	}
@@ -1119,24 +1119,24 @@ BOOL LLViewerWindow::handleMouseUp(LLWindow *window,  LLCoordGL pos, MASK mask)
         mMouseDownTimer.stop();
     }
     BOOL down = FALSE;
-    return gViewerKeyboard.handleMouse(window, pos, mask, CLICK_LEFT, down);
+    return gViewerInput.handleMouse(window, pos, mask, CLICK_LEFT, down);
 }
 BOOL LLViewerWindow::handleRightMouseDown(LLWindow *window,  LLCoordGL pos, MASK mask)
 {
 	BOOL down = TRUE;
-	return gViewerKeyboard.handleMouse(window, pos, mask, CLICK_RIGHT, down);
+	return gViewerInput.handleMouse(window, pos, mask, CLICK_RIGHT, down);
 }
 
 BOOL LLViewerWindow::handleRightMouseUp(LLWindow *window,  LLCoordGL pos, MASK mask)
 {
 	BOOL down = FALSE;
- 	return gViewerKeyboard.handleMouse(window, pos, mask, CLICK_RIGHT, down);
+ 	return gViewerInput.handleMouse(window, pos, mask, CLICK_RIGHT, down);
 }
 
 BOOL LLViewerWindow::handleMiddleMouseDown(LLWindow *window,  LLCoordGL pos, MASK mask)
 {
 	BOOL down = TRUE;
- 	gViewerKeyboard.handleMouse(window, pos, mask, CLICK_MIDDLE, down);
+ 	gViewerInput.handleMouse(window, pos, mask, CLICK_MIDDLE, down);
   
   	// Always handled as far as the OS is concerned.
 	return TRUE;
@@ -1291,7 +1291,7 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi
 BOOL LLViewerWindow::handleMiddleMouseUp(LLWindow *window,  LLCoordGL pos, MASK mask)
 {
 	BOOL down = FALSE;
- 	gViewerKeyboard.handleMouse(window, pos, mask, CLICK_MIDDLE, down);
+ 	gViewerInput.handleMouse(window, pos, mask, CLICK_MIDDLE, down);
   
   	// Always handled as far as the OS is concerned.
 	return TRUE;
@@ -1302,10 +1302,10 @@ BOOL LLViewerWindow::handleOtherMouse(LLWindow *window, LLCoordGL pos, MASK mask
     switch (button)
     {
     case 4:
-        gViewerKeyboard.handleMouse(window, pos, mask, CLICK_BUTTON4, down);
+        gViewerInput.handleMouse(window, pos, mask, CLICK_BUTTON4, down);
         break;
     case 5:
-        gViewerKeyboard.handleMouse(window, pos, mask, CLICK_BUTTON5, down);
+        gViewerInput.handleMouse(window, pos, mask, CLICK_BUTTON5, down);
         break;
     default:
         break;
@@ -1470,7 +1470,7 @@ BOOL LLViewerWindow::handleTranslatedKeyDown(KEY key,  MASK mask, BOOL repeated)
 	}
 
     // remaps, handles ignored cases and returns back to viewer window.
-    return gViewerKeyboard.handleKey(key, mask, repeated);
+    return gViewerInput.handleKey(key, mask, repeated);
 }
 
 BOOL LLViewerWindow::handleTranslatedKeyUp(KEY key,  MASK mask)
@@ -1482,13 +1482,13 @@ BOOL LLViewerWindow::handleTranslatedKeyUp(KEY key,  MASK mask)
 		tool_inspectp->keyUp(key, mask);
 	}
 
-	return gViewerKeyboard.handleKeyUp(key, mask);
+	return gViewerInput.handleKeyUp(key, mask);
 }
 
 void LLViewerWindow::handleScanKey(KEY key, BOOL key_down, BOOL key_up, BOOL key_level)
 {
 	LLViewerJoystick::getInstance()->setCameraNeedsUpdate(true);
-	gViewerKeyboard.scanKey(key, key_down, key_up, key_level);
+	gViewerInput.scanKey(key, key_down, key_up, key_level);
 	return; // Be clear this function returns nothing
 }
 
@@ -2944,7 +2944,7 @@ BOOL LLViewerWindow::handleUnicodeChar(llwchar uni_char, MASK mask)
 		if (mask != MASK_ALT)
 		{
 			// remaps, handles ignored cases and returns back to viewer window.
-			return gViewerKeyboard.handleKey(KEY_RETURN, mask, gKeyboard->getKeyRepeated(KEY_RETURN));
+			return gViewerInput.handleKey(KEY_RETURN, mask, gKeyboard->getKeyRepeated(KEY_RETURN));
 		}
 	}
 
diff --git a/indra/newview/llwindowlistener.cpp b/indra/newview/llwindowlistener.cpp
index 9e4297baafc..aa8c79b0d28 100644
--- a/indra/newview/llwindowlistener.cpp
+++ b/indra/newview/llwindowlistener.cpp
@@ -37,7 +37,7 @@
 #include "llview.h"
 #include "llviewinject.h"
 #include "llviewerwindow.h"
-#include "llviewerkeyboard.h"
+#include "llviewerinput.h"
 #include "llrootview.h"
 #include "llsdutil.h"
 #include "stringize.h"
@@ -279,7 +279,7 @@ void LLWindowListener::keyDown(LLSD const & evt)
 			response.setResponse(target_view->getInfo());
 			
 			gFocusMgr.setKeyboardFocus(target_view);
-			gViewerKeyboard.handleKey(key, mask, false);
+			gViewerInput.handleKey(key, mask, false);
 			if(key < 0x80) mWindow->handleUnicodeChar(key, mask);
 		}
 		else 
@@ -291,7 +291,7 @@ void LLWindowListener::keyDown(LLSD const & evt)
 	}
 	else 
 	{
-		gViewerKeyboard.handleKey(key, mask, false); 
+		gViewerInput.handleKey(key, mask, false); 
 		if(key < 0x80) mWindow->handleUnicodeChar(key, mask);
 	}
 }
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_controls.xml b/indra/newview/skins/default/xui/en/panel_preferences_controls.xml
index ac4be34be25..62267dce8af 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_controls.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_controls.xml
@@ -285,7 +285,7 @@
    width="110"
    label="Restore Default"
    name="restore_defaults"/>
-  
+
   <scroll_list
    draw_heading="true"
    follows="all"
@@ -315,8 +315,5 @@
      relative_width="0.22"
      label="Control Method 3"
      name="lst_ctrl3" />
-    <scroll_list.commit_callback
-      function="Pref.CommitControl" />
   </scroll_list>
-
 </panel>
-- 
GitLab