Exemple #1
0
 static XInput()
 {
     if (IsUAP())
     {
         s_xInput = new XInput14();
         Version  = XInputVersion.Version14;
     }
     if (LoadLibrary("xinput1_4.dll") != IntPtr.Zero)
     {
         s_xInput = new XInput14();
         Version  = XInputVersion.Version14;
     }
     else if (LoadLibrary("xinput1_3.dll") != IntPtr.Zero)
     {
         s_xInput = new XInput13();
         Version  = XInputVersion.Version13;
     }
     else if (LoadLibrary("xinput9_1_0.dll") != IntPtr.Zero)
     {
         s_xInput = new XInput910();
         Version  = XInputVersion.Version910;
     }
     else
     {
         throw new PlatformNotSupportedException("XInput is not supported");
     }
 }
 static XboxController()
 {
     _xInput=new XInputUniversal();
     Controllers = new XboxController[MAX_CONTROLLER_COUNT];
     SyncLock = new object();
     for (int i = FIRST_CONTROLLER_INDEX; i <= LAST_CONTROLLER_INDEX; ++i)
     {
         Controllers[i] = new XboxController(i);
     }
     UpdateFrequency = 25;
 }
 static XboxController()
 {
     _xInput     = new XInputUniversal();
     Controllers = new XboxController[MAX_CONTROLLER_COUNT];
     SyncLock    = new object();
     for (int i = FIRST_CONTROLLER_INDEX; i <= LAST_CONTROLLER_INDEX; ++i)
     {
         Controllers[i] = new XboxController(i);
     }
     UpdateFrequency = 25;
 }
Exemple #4
0
        public Controller(IEventFactory eventFactory, IXInput xInput, IUser32 user32, IList <KeyBinding> keyBindings)
        {
            EventFactory = eventFactory;

            KeyBindings  = new KeyBindings(keyBindings);
            Synchronizer = new Synchronizer();

            Gamepad  = new Gamepad(xInput);
            Mouse    = new Mouse(user32);
            Keyboard = new Keyboard(user32);
        }
Exemple #5
0
 static Controller()
 {
     if (LoadLibrary("xinput1_4.dll") != IntPtr.Zero)
     {
         xinput = new XInput14();
     }
     else if (LoadLibrary("xinput1_3.dll") != IntPtr.Zero)
     {
         xinput = new XInput13();
     }
     else if (LoadLibrary("xinput9_1_0.dll") != IntPtr.Zero)
     {
         xinput = new XInput13();
     }
 }
Exemple #6
0
 static XInput()
 {
     if (LoadLibrary("xinput1_4.dll") != IntPtr.Zero)
     {
         s_xInput = new XInput14();
         Version  = XInputVersion.Version14;
     }
     else if (LoadLibrary("xinput1_3.dll") != IntPtr.Zero)
     {
         s_xInput = new XInput13();
         Version  = XInputVersion.Version13;
     }
     else if (LoadLibrary("xinput9_1_0.dll") != IntPtr.Zero)
     {
         s_xInput = new XInput910();
         Version  = XInputVersion.Version910;
     }
 }
 static Controller()
 {
     if (LoadLibrary("xinput1_4.dll") != IntPtr.Zero)
     {
         xinput = (IXInput) new XInput14();
     }
     else if (LoadLibrary("xinput1_3.dll") != IntPtr.Zero)
     {
         xinput = (IXInput) new XInput13();
     }
     else
     {
         if (!(LoadLibrary("xinput9_1_0.dll") != IntPtr.Zero))
         {
             return;
         }
         xinput = (IXInput) new XInput910();
     }
 }
Exemple #8
0
 public Gamepad(IXInput driver)
 {
     _driver = driver;
 }
Exemple #9
0
 static Controller()
 {
     xinput = new XInput14();
 }
Exemple #10
0
 static Controller()
 {
     xinput = new XInput14();
 }
Exemple #11
0
 static Controller()
 {
     if(LoadLibrary("xinput1_4.dll") != IntPtr.Zero)
     {
         xinput = new XInput14();
     }
     else if (LoadLibrary("xinput1_3.dll") != IntPtr.Zero)
     {
         xinput = new XInput13();
     }
     else if (LoadLibrary("xinput9_1_0.dll") != IntPtr.Zero)
     {
         xinput = new XInput13();
     }
 }