public void SetButtonState(InputData.InputButton button, InputData.FramePressState stateForMouseButton, InputData data) { ButtonState toModify = this.GetButtonState(button); toModify.eventData.buttonState = stateForMouseButton; toModify.eventData.buttonData = data; }
public ButtonState GetButtonState(InputData.InputButton button) { ButtonState tracked = null; int count = this._trackedButtons.Count; for (int i = 0; i < count; i++) { if (this._trackedButtons[i].button == button) { tracked = this._trackedButtons[i]; break; } } if (tracked == null) { tracked = new ButtonState { button = button, eventData = new MouseButtonEventData() }; this._trackedButtons.Add(tracked); } return(tracked); }