コード例 #1
0
            public ControlsInput(IniFileSection section, Keys key)
            {
                _joy          = section.GetInt("JOY", -1);
                _button       = section.GetInt("BUTTON", -1);
                _pov          = section.GetInt("__CM_POV", -1);
                _povDirection = section.GetIntEnum("__CM_POV_DIR", DirectInputPovDirection.Up);

                var k = section.GetInt("KEY", -1);

                _key = k == -1 ? key : (Keys)k;
            }
コード例 #2
0
        public static bool IsInRange(this DirectInputPovDirection direction, int value)
        {
            switch (direction)
            {
            case DirectInputPovDirection.Left:
                return(value > 22500 && value <= 31500);

            case DirectInputPovDirection.Up:
                return(value >= 0 && value <= 4500 || value > 31500);

            case DirectInputPovDirection.Right:
                return(value > 4500 && value <= 13500);

            case DirectInputPovDirection.Down:
                return(value > 13500 && value <= 22500);

            default:
                throw new ArgumentOutOfRangeException(nameof(direction), direction, null);
            }
        }
コード例 #3
0
 public DirectInputPov GetPov(int id, DirectInputPovDirection direction)
 {
     return(id < 0 ? null : Povs.FirstOrDefault(x => x.Id == id && x.Direction == direction));
 }
コード例 #4
0
ファイル: DirectInputPov.cs プロジェクト: windygu/actools
 public DirectInputPov(IDirectInputDevice device, int id, DirectInputPovDirection direction) : base(device, id)
 {
     Direction = direction;
     SetDisplayParams(null, true);
 }