Наследование: IKeyboardDriver2
Пример #1
0
 protected override void CreateDrivers()
 {
     this.keyboard_driver = new WinRawKeyboard(this.Parent.WindowHandle);
       this.mouse_driver = new WinRawMouse(this.Parent.WindowHandle);
       this.joystick_driver = new WinMMJoystick();
       this.DevNotifyHandle = WinRawInput.RegisterForDeviceNotifications(this.Parent);
 }
Пример #2
0
 protected override void CreateDrivers()
 {
     keyboard_driver = new WinRawKeyboard(Parent.Handle);
     mouse_driver    = new WinRawMouse(Parent.Handle);
     joystick_driver = new WinRawJoystick(Parent.Handle);
     DevNotifyHandle = RegisterForDeviceNotifications(Parent);
 }
Пример #3
0
 protected override void CreateDrivers()
 {
     this.keyboard_driver = new WinRawKeyboard(this.Parent.WindowHandle);
     this.mouse_driver    = new WinRawMouse(this.Parent.WindowHandle);
     this.joystick_driver = new WinMMJoystick();
     this.DevNotifyHandle = WinRawInput.RegisterForDeviceNotifications(this.Parent);
 }
Пример #4
0
 public void RefreshDevices()
 {
     lock (this.UpdateLock)
     {
         for (int local_0 = 0; local_0 < this.keyboards.Count; ++local_0)
         {
             KeyboardState local_1 = this.keyboards[local_0];
             local_1.IsConnected     = false;
             this.keyboards[local_0] = local_1;
         }
         int local_2 = WinRawInput.DeviceCount;
         RawInputDeviceList[] local_3 = new RawInputDeviceList[local_2];
         for (int local_4 = 0; local_4 < local_2; ++local_4)
         {
             local_3[local_4] = new RawInputDeviceList();
         }
         Functions.GetRawInputDeviceList(local_3, out local_2, API.RawInputDeviceListSize);
         foreach (RawInputDeviceList item_0 in local_3)
         {
             ContextHandle local_6 = new ContextHandle(item_0.Device);
             if (this.rawids.ContainsKey(local_6))
             {
                 KeyboardState local_7 = this.keyboards[this.rawids[local_6]];
                 local_7.IsConnected = true;
                 this.keyboards[this.rawids[local_6]] = local_7;
             }
             else
             {
                 string local_8 = WinRawKeyboard.GetDeviceName(item_0);
                 if (!local_8.ToLower().Contains("root") && (item_0.Type == RawInputDeviceType.KEYBOARD || item_0.Type == RawInputDeviceType.HID))
                 {
                     RegistryKey local_9  = WinRawKeyboard.GetRegistryKey(local_8);
                     string      local_10 = (string)local_9.GetValue("DeviceDesc");
                     string      local_11 = (string)local_9.GetValue("Class");
                     if (!string.IsNullOrEmpty(local_10))
                     {
                         string local_10_1 = local_10.Substring(local_10.LastIndexOf(';') + 1);
                         if (!string.IsNullOrEmpty(local_11) && local_11.ToLower().Equals("keyboard"))
                         {
                             RawInputDeviceInfo local_12 = new RawInputDeviceInfo();
                             int local_13 = API.RawInputDeviceInfoSize;
                             Functions.GetRawInputDeviceInfo(item_0.Device, RawInputDeviceInfoEnum.DEVICEINFO, local_12, out local_13);
                             WinRawKeyboard.RegisterKeyboardDevice(this.window, local_10_1);
                             this.keyboards.Add(new KeyboardState()
                             {
                                 IsConnected = true
                             });
                             this.names.Add(local_10_1);
                             this.rawids.Add(new ContextHandle(item_0.Device), this.keyboards.Count - 1);
                         }
                     }
                 }
             }
         }
     }
 }
Пример #5
0
 internal WinRawInput(WinWindowInfo parent)
 {
     Debug.WriteLine("Initalizing windows raw input driver.");
     Debug.Indent();
     AssignHandle(parent.WindowHandle);
     Debug.Print("Input window attached to parent {0}", parent);
     keyboardDriver = new WinRawKeyboard(this.Handle);
     mouseDriver    = new WinRawMouse(this.Handle);
     Debug.Unindent();
     //AllocateBuffer();
 }
Пример #6
0
 internal WinRawInput(WinWindowInfo parent)
 {
     Debug.WriteLine("Initalizing windows raw input driver.");
     Debug.Indent();
     AssignHandle(parent.WindowHandle);
     Debug.Print("Input window attached to parent {0}", parent);
     keyboardDriver = new WinRawKeyboard(this.Handle);
     mouseDriver = new WinRawMouse(this.Handle);
     Debug.Unindent();
     //AllocateBuffer();
 }
Пример #7
0
        protected override void CreateDrivers()
        {
            keyboard_driver = new WinRawKeyboard(Parent.Handle);
            mouse_driver    = new WinRawMouse(Parent.Handle);
            joystick_driver = new WinMMJoystick();
            try
            {
                gamepad_driver = new XInputJoystick();
            }
            catch (Exception)
            {
                Debug.Print("[Win] XInput driver not supported, falling back to WinMM");
                gamepad_driver = new MappedGamePadDriver();
            }

            DevNotifyHandle = RegisterForDeviceNotifications(Parent);
        }
        protected override void CreateDrivers()
        {
            keyboard_driver = new WinRawKeyboard(Parent.WindowHandle);
            mouse_driver = new WinRawMouse(Parent.WindowHandle);
            joystick_driver = new WinMMJoystick();

            DevNotifyHandle = RegisterForDeviceNotifications(Parent);
        }
Пример #9
0
        protected override void CreateDrivers()
        {
            keyboard_driver = new WinRawKeyboard(Parent.Handle);
            mouse_driver = new WinRawMouse(Parent.Handle);
            joystick_driver = new WinMMJoystick();
            try
            {
                gamepad_driver = new XInputJoystick();
            }
            catch (Exception e)
            {
                Debug.Print("[Win] XInput driver not supported, falling back to WinMM");
                gamepad_driver = new MappedGamePadDriver();
            }

            DevNotifyHandle = RegisterForDeviceNotifications(Parent);
        }