示例#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");
     }
 }
示例#2
0
 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;
 }
示例#3
0
 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;
 }
示例#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);
        }
示例#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();
     }
 }
示例#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();
     }
 }
示例#8
0
 public Gamepad(IXInput driver)
 {
     _driver = driver;
 }
示例#9
0
 static Controller()
 {
     xinput = new XInput14();
 }
示例#10
0
 static Controller()
 {
     xinput = new XInput14();
 }
示例#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();
     }
 }