Exemplo n.º 1
0
        public static List <JoystickDevice> Search()
        {
            List <JoystickDevice> Joysticks = new List <JoystickDevice>();

            JOYCAPS CapturedJoysticks;
            uint    devs = JoystickMethods.joyGetNumDevs();

            for (deviceNumber = 0; deviceNumber < devs; deviceNumber++)
            {
                UInt32 res = JoystickMethods.joyGetDevCaps(deviceNumber, out CapturedJoysticks, JOYCAPS.Size);
                if (res != 165)
                {
                    Joysticks.Add(new JoystickDevice(CapturedJoysticks, deviceNumber));
                }
            }

            return(Joysticks);
        }
Exemplo n.º 2
0
 public void GetJoystickData()
 {
     joyInfo.dwSize  = (Int32)Marshal.SizeOf(joyInfo);
     joyInfo.dwFlags = JoystickFlags.JOY_RETURNALL;
     JoystickMethods.joyGetPosEx(device.id, out joyInfo);
 }