public static TVButtonState NextState(this TVButtonState state, bool pressed) { switch (state) { case TVButtonState.Up: return(pressed ? TVButtonState.Pressed : TVButtonState.Up); case TVButtonState.Pressed: return(pressed ? TVButtonState.Down : TVButtonState.Released); case TVButtonState.Released: return(pressed ? TVButtonState.Pressed : TVButtonState.Up); default: case TVButtonState.Down: return(pressed ? TVButtonState.Down : TVButtonState.Released); } }
TimedButtonState(TVButtonState state, TimeSpan timePressed) { State = state; TimePressed = timePressed; }
TimedAnalogButtonState(float value, TVButtonState state, TimeSpan timePressed) { Value = value; State = state; TimePressed = timePressed; }