Example #1
0
        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);
            }
        }
Example #2
0
 TimedButtonState(TVButtonState state, TimeSpan timePressed)
 {
     State       = state;
     TimePressed = timePressed;
 }
Example #3
0
 TimedAnalogButtonState(float value, TVButtonState state, TimeSpan timePressed)
 {
     Value       = value;
     State       = state;
     TimePressed = timePressed;
 }
Example #4
0
 TimedButtonState(TVButtonState state, TimeSpan timePressed)
 {
     State = state;
     TimePressed = timePressed;
 }
Example #5
0
 TimedAnalogButtonState(float value, TVButtonState state, TimeSpan timePressed)
 {
     Value = value;
     State = state;
     TimePressed = timePressed;
 }