public void SetButton(EnumButton button) { switch (button) { case EnumButton.OKCancel: buttonOk.Visible = true; AcceptButton = buttonOk; CancelButton = buttonCancel; buttonCancel.Visible = true; buttonCancel.Click += OnCloseMessage; break; case EnumButton.YesNo: buttonNo.Visible = true; buttonYes.Visible = true; buttonCancel.Visible = false; break; //case EnumButton.OK: default: buttonOk.Visible = true; buttonOk.Click += OnCloseMessage; AcceptButton = buttonOk; buttonOk.Select(); break; } }
/// <summary> /// Set the button's state to true (on). If the button does pass the hard pressed test, /// the Gamepad manager keeps track of the situation. /// </summary> public void fireButton(EnumButton button) { buttonsState[(int)button] = true; }
/// <summary> /// Returns true if the buttons has being pressed for a threshold time enough to /// be considered as hard pressed. Eitherway false. /// </summary> /// <returns>bool</returns> /// <param name='button'>The button enum value</param> public bool isHardPressed(EnumButton button) { return(triggerEnabled && hardPressedCount[(int)button] >= HARD_PRESSED_MIN_COUNT); }
/// <summary> /// Returns true if the buttons has being pressed for a threshold time enough to /// be considered as hard pressed. Eitherway false. /// </summary> /// <returns> /// bool /// </returns> /// <param name='button'> /// The button enum value /// </param> public static bool isHardPressed(EnumButton button) { return(hardPressedCount[(int)button] >= HARD_PRESSED_MIN_COUNT); }