Example #1
0
        private static void Main(string[] args)
        {
            SlimDX.DirectInput.DirectInput dinput = new SlimDX.DirectInput.DirectInput();
            foreach (SlimDX.DirectInput.DeviceInstance device in dinput.GetDevices(SlimDX.DirectInput.DeviceClass.GameController, SlimDX.DirectInput.DeviceEnumerationFlags.AttachedOnly))
            {
                DirectX.Joystick.onLog = logMessages;
                DirectX.Joystick.debug = false;
                joystick = new DirectX.Joystick(dinput, device);



                joystick.axisX.min        = 1;
                joystick.axisX.max        = 99;
                joystick.axisX.deadZone   = 1800;
                joystick.axisX.saturation = 10000;

                joystick.axisY.min        = 101;
                joystick.axisY.max        = 199;
                joystick.axisY.deadZone   = 1800;
                joystick.axisY.saturation = 10000;

                joystick.axisZ.min        = 201;
                joystick.axisZ.max        = 299;
                joystick.axisZ.deadZone   = 1800;
                joystick.axisZ.saturation = 10000;

                joystick.axisRx.min        = 301;
                joystick.axisRx.max        = 399;
                joystick.axisRx.deadZone   = 2000;
                joystick.axisRx.saturation = 10000;

                joystick.axisRy.min        = 401;
                joystick.axisRy.max        = 499;
                joystick.axisRy.deadZone   = 2000;
                joystick.axisRy.saturation = 10000;

                joystick.axisRz.min        = 501;
                joystick.axisRz.max        = 599;
                joystick.axisRz.deadZone   = 2000;
                joystick.axisRz.saturation = 10000;

                joystick.axisExtra.min        = 601;
                joystick.axisExtra.max        = 699;
                joystick.axisExtra.deadZone   = 2000;
                joystick.axisExtra.saturation = 10000;

                joystick.setJoystickValues();

                controlHelper = new controllHelper(joystick);
                joystick.start();


                break;
            }

            Console.WriteLine("Press any key to exit");
            Console.ReadKey();
        }
Example #2
0
        public controllHelper(DirectX.Joystick joystick)
        {
            this.joystick = joystick;

            joystick.onAxisX     += onAxisX;
            joystick.onAxisY     += onAxisY;
            joystick.onAxisZ     += onAxisZ;
            joystick.onAxisRz    += onAxisRz;
            joystick.onAxisRx    += onAxisRx;
            joystick.onAxisRy    += onAxisRy;
            joystick.onButton    += onButton;
            joystick.onPov       += onPov;
            joystick.onAxisExtra += onAxisExtra;
        }