Beispiel #1
0
    /// <summary>
    /// Gets the button down.
    /// </summary>
    /// <returns><c>true</c>, if button is down this frame, <c>false</c> otherwise.</returns>
    /// <param name="buttonId">Button identifier.</param>
    //---------------------------------------------------------------------------------------------
    public bool GetButtonDown(svrControllerButton buttonId)
    {
        int mask = (int)buttonId;

        return(((previousButtonState & mask) == 0) && ((currentState.buttonState & mask) != 0));
    }
Beispiel #2
0
    /// <summary>
    /// Gets the current state of the button.
    /// </summary>
    /// <returns><c>true</c>, if button is down, <c>false</c> otherwise.</returns>
    /// <param name="buttonId">Button identifier.</param>
    //---------------------------------------------------------------------------------------------
    public bool GetButton(svrControllerButton buttonId)
    {
        int mask = (int)buttonId;

        return((currentState.buttonState & mask) != 0);
    }