private void OverwriteAssignment(MyControl controlAlreadySet, MyKeys key) { Debug.Assert(controlAlreadySet != null); Debug.Assert(m_deviceType == MyGuiInputDeviceEnum.Keyboard || m_deviceType == MyGuiInputDeviceEnum.KeyboardSecond); Debug.Assert(controlAlreadySet.GetKeyboardControl() == key || controlAlreadySet.GetSecondKeyboardControl() == key); if (controlAlreadySet.GetKeyboardControl() == key) { controlAlreadySet.SetControl(MyGuiInputDeviceEnum.Keyboard, MyKeys.None); } else { controlAlreadySet.SetControl(MyGuiInputDeviceEnum.KeyboardSecond, MyKeys.None); } m_controlBeingSet.SetControl(m_deviceType, key); }