Пример #1
0
 // constructor
 public StickEventArgs(int controller, XboxSide side, XboxStickDirection direction, double x, double y)
 {
     Controller = controller;
     Side       = side;
     Direction  = direction;
     X          = x;
     Y          = y;
 }
Пример #2
0
 public override double GetTriggerPressure(int controller, XboxSide side)
 {
     if (side == XboxSide.None || controller < 0 || controller >= controllers.Length || !controllers[controller].IsConnected)
     {
         return(0.0d);
     }
     return((side == XboxSide.Left) ? states[controller].LeftTrigger / 255.0d : states[controller].RightTrigger / 255.0d);
 }
Пример #3
0
        public override PointD GetStickPosition(int controller, XboxSide side)
        {
            if (side == XboxSide.None || controller < 0 || controller >= controllers.Length || !controllers[controller].IsConnected)
            {
                return(new PointD());
            }

            if (side == XboxSide.Left)
            {
                return(new PointD((states[controller].LeftThumbX < 0) ? states[controller].LeftThumbX / 32768.0d : states[controller].LeftThumbX / 32767.0d, (states[controller].LeftThumbY < 0) ? states[controller].LeftThumbY / 32768.0d : states[controller].LeftThumbY / 32767.0d));
            }

            return(new PointD((states[controller].RightThumbX < 0) ? states[controller].RightThumbX / 32768.0d : states[controller].RightThumbX / 32767.0d, (states[controller].RightThumbY < 0) ? states[controller].RightThumbY / 32768.0d : states[controller].RightThumbY / 32767.0d));
        }
 public abstract PointD GetStickPosition(int controller, XboxSide side);
 public abstract double GetTriggerPressure(int controller, XboxSide side);
 // constructor
 public TriggerEventArgs(int controller, XboxSide side, double pressure)
 {
     Controller = controller;
     Side       = side;
     Pressure   = pressure;
 }