private void AssignAlreadyAssignedCommand(MyGuiScreenMessageBoxCallbackEnum r, MyControl control) { if (r == MyGuiScreenMessageBoxCallbackEnum.YES) { switch (m_deviceType) { case MyGuiInputDeviceEnum.Keyboard: m_control.SetControl(control.GetKeyboardControl()); control.SetControl(Keys.None); break; case MyGuiInputDeviceEnum.Mouse: m_control.SetControl(control.GetMouseControl()); control.SetControl(MyMouseButtonsEnum.None); break; case MyGuiInputDeviceEnum.Joystick: m_control.SetControl(control.GetJoystickControl()); control.SetControl(MyJoystickButtonsEnum.None); break; case MyGuiInputDeviceEnum.JoystickAxis: m_control.SetControl(control.GetJoystickAxisControl()); control.SetControl(MyJoystickAxesEnum.None); break; } m_buttonsDictionary[m_control].SetText(new StringBuilder(m_control.GetControlButtonName(m_deviceType))); if (m_buttonsDictionary.ContainsKey(control)) { m_buttonsDictionary[control].SetText(new StringBuilder(control.GetControlButtonName(m_deviceType))); } CloseScreen(); } else { MyGuiManager.GetInput().GetListOfPressedKeys(m_oldPressedKeys); MyGuiManager.GetInput().GetListOfPressedMouseButtons(m_oldPressedMouseButtons); MyGuiManager.GetInput().GetListOfPressedJoystickButtons(m_oldPressedJoystickButtons); MyGuiManager.GetInput().GetListOfPressedJoystickAxes(m_oldPressedJoystickAxes); } }