Ejemplo n.º 1
0
        private Vector2 CalcDeadZone(GamepadThumb input, ThumbConfiguration config)
        {
            var vec = (Vector2)input.Vector.Clone();

            vec.X = ClampValue(vec.X, config.DeadZoneX / 100f);
            vec.Y = ClampValue(vec.Y, config.DeadZoneY / 100f);
            return(vec);
        }
Ejemplo n.º 2
0
        public SmartController()
        {
            Controller   = new Controller(UserIndex.One);
            LeftThumb    = new GamepadThumb();
            RightThumb   = new GamepadThumb();
            LeftTrigger  = new GamepadTrigger();
            RightTrigger = new GamepadTrigger();
            var vls = (GamepadButtons[])Enum.GetValues(typeof(GamepadButtons));

            Buttons = vls.Select(x => new GamepadButton(toSharpDx[(int)x], x)).ToArray();

            active              = true;
            updateRate          = (int)(1000f / 60f);
            thread              = new Thread(BackgroundThread);
            thread.IsBackground = true;
            thread.Start();
        }