コード例 #1
0
        private int TranslateAxes(ref XInputGamePad pad)
        {
            var count = 0;

            count += pad.ThumbLX != 0 ? 1 : 0;
            count += pad.ThumbLY != 0 ? 1 : 0;
            count += pad.ThumbRX != 0 ? 1 : 0;
            count += pad.ThumbRY != 0 ? 1 : 0;
            count += pad.LeftTrigger != 0 ? 1 : 0;
            count += pad.RightTrigger != 0 ? 1 : 0;
            return(count);
        }
コード例 #2
0
ファイル: XInputJoystick.cs プロジェクト: valera6285/opentk
        GamePadAxes TranslateAxes(ref XInputGamePad pad)
        {
            GamePadAxes axes = 0;

            axes |= pad.ThumbLX != 0 ? GamePadAxes.LeftX : 0;
            axes |= pad.ThumbLY != 0 ? GamePadAxes.LeftY : 0;
            axes |= pad.LeftTrigger != 0 ? GamePadAxes.LeftTrigger : 0;
            axes |= pad.ThumbRX != 0 ? GamePadAxes.RightX : 0;
            axes |= pad.ThumbRY != 0 ? GamePadAxes.RightY : 0;
            axes |= pad.RightTrigger != 0 ? GamePadAxes.RightTrigger : 0;
            return(axes);
        }
コード例 #3
0
 GamePadAxes TranslateAxes(ref XInputGamePad pad)
 {
     GamePadAxes axes = 0;
     axes |= pad.ThumbLX != 0 ? GamePadAxes.LeftX : 0;
     axes |= pad.ThumbLY != 0 ? GamePadAxes.LeftY : 0;
     axes |= pad.LeftTrigger != 0 ? GamePadAxes.LeftTrigger : 0;
     axes |= pad.ThumbRX != 0 ? GamePadAxes.RightX : 0;
     axes |= pad.ThumbRY != 0 ? GamePadAxes.RightY : 0;
     axes |= pad.RightTrigger != 0 ? GamePadAxes.RightTrigger : 0;
     return axes;
 }
コード例 #4
0
ファイル: XInputJoystick.cs プロジェクト: RockyTV/opentk
 int TranslateAxes(ref XInputGamePad pad)
 {
     int count = 0;
     count += pad.ThumbLX != 0 ? 1 : 0;
     count += pad.ThumbLY != 0 ? 1 : 0;
     count += pad.ThumbRX != 0 ? 1 : 0;
     count += pad.ThumbRY != 0 ? 1 : 0;
     count += pad.LeftTrigger != 0 ? 1 : 0;
     count += pad.RightTrigger != 0 ? 1 : 0;
     return count;
 }