Added buttons to the build engineer settings for key binding the show/hide hotkey functionality.
Added buttons to the build engineer settings for key binding the show/hide hotkey functionality.

--- a/KerbalEngineer/Editor/BuildAdvanced.cs
+++ b/KerbalEngineer/Editor/BuildAdvanced.cs
@@ -560,6 +560,18 @@
             GUILayout.Label("Minimum delay between simulations: " + SimManager.minSimTime.TotalMilliseconds + "ms", settingStyle);
             GUI.skin = HighLogic.Skin;
             SimManager.minSimTime = TimeSpan.FromMilliseconds(GUILayout.HorizontalSlider((float)SimManager.minSimTime.TotalMilliseconds, 0, 2000.0f));
+
+            GUILayout.BeginHorizontal();
+            if (GUILayout.Button("Editor Show/Hide Key: " + KeyBinder.EditorShowHide, buttonStyle, GUILayout.Width(200.0f * GuiDisplaySize.Offset)))
+            {
+                SelectKeyBindPopup.Show("Flight Show/Hide", KeyBinder.EditorShowHide, keyCode => KeyBinder.EditorShowHide = keyCode);
+            }
+            if (GUILayout.Button("Flight Show/Hide Key: " + KeyBinder.FlightShowHide, buttonStyle, GUILayout.Width(200.0f * GuiDisplaySize.Offset)))
+            {
+                SelectKeyBindPopup.Show("Flight Show/Hide", KeyBinder.FlightShowHide, keyCode => KeyBinder.FlightShowHide = keyCode);
+            }
+            GUILayout.EndHorizontal();
+
             GUI.skin = null;
         }
 

--- a/KerbalEngineer/KerbalEngineer.csproj
+++ b/KerbalEngineer/KerbalEngineer.csproj
@@ -221,7 +221,7 @@
     <Compile Include="Settings\SettingHandler.cs" />
     <Compile Include="Settings\SettingItem.cs" />
     <Compile Include="TapeDriveAnimator.cs" />
-    <Compile Include="UIControls\InputCheck.cs" />
+    <Compile Include="UIControls\SelectKeyBindPopup.cs" />
     <Compile Include="UIControls\WindowObject.cs" />
     <Compile Include="VesselSimulator\AttachNodeSim.cs" />
     <Compile Include="VesselSimulator\EngineSim.cs" />

--- a/KerbalEngineer/UIControls/SelectKeyBindPopup.cs
+++ b/KerbalEngineer/UIControls/SelectKeyBindPopup.cs
@@ -53,6 +53,11 @@
         /// </summary>
         public static void Show(string name, KeyCode currentBinding, Action<KeyCode> acceptClicked)
         {
+            if (IsOpen)
+            {
+                return;
+            }
+
             SelectKeyBindPopup selectKeyBindPopup = new GameObject("SelectKeyBind").AddComponent<SelectKeyBindPopup>();
             selectKeyBindPopup.Name = name;
             selectKeyBindPopup.Binding = currentBinding;
@@ -84,7 +89,14 @@
         /// </summary>
         protected virtual void Awake()
         {
-            IsOpen = true;
+            if (IsOpen)
+            {
+                OnCancel();
+            }
+            else
+            {
+                IsOpen = true;
+            }
         }
 
         /// <summary>
@@ -101,13 +113,7 @@
         protected virtual void OnGUI()
         {
             position = GUILayout.Window(GetInstanceID(), position, RenderWindow, "Select Key Bind", HighLogic.Skin.window);
-
-            // Centre the window.
-            if (isCentred == false)
-            {
-                isCentred = true;
-                CentreWindow();
-            }
+            CentreWindow();
         }
 
         /// <summary>
@@ -124,8 +130,9 @@
         /// </summary>
         private void CentreWindow()
         {
-            if (position.width > 0.0f && position.height > 0.0f)
+            if (isCentred == false && position.width > 0.0f && position.height > 0.0f)
             {
+                isCentred = true;
                 position.center = new Vector2(Screen.width * 0.5f, Screen.height * 0.5f);
             }
         }
@@ -166,6 +173,12 @@
             for (int i = 0; i < availableBindings.Length; ++i)
             {
                 KeyCode keyCode = (KeyCode)availableBindings.GetValue(i);
+
+                if (keyCode == KeyCode.Mouse0)
+                {
+                    continue;
+                }
+
                 if (Input.GetKeyDown(keyCode))
                 {
                     Binding = keyCode;

 Binary files a/Output/KerbalEngineer/KerbalEngineer.dll and b/Output/KerbalEngineer/KerbalEngineer.dll differ