joystickButtonChanged() public method

public joystickButtonChanged ( int button, String state ) : void
button int
state String
return void
Exemplo n.º 1
0
        private void buttonPressed(int offset, int value)
        {
            string state;

            // check button state based on value
            // this is the inverse of OS X, where != 0 is up
            if (value == 0)
            {
                state = "Up";
            }
            else
            {
                state = "Down";
            }

            var offsetValue = int.Parse(offset.ToString().Replace("Buttons", "")); // leave just a number

            commands.joystickButtonChanged(offsetValue, state);
        }