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); }
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); }
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(); }
public void RefreshDevices() { lock (this.UpdateLock) { for (int local_0 = 0; local_0 < this.mice.Count; ++local_0) { MouseState local_1 = this.mice[local_0]; local_1.IsConnected = false; this.mice[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)) { MouseState local_7 = this.mice[this.rawids[local_6]]; local_7.IsConnected = true; this.mice[this.rawids[local_6]] = local_7; } else { string local_8 = WinRawMouse.GetDeviceName(item_0); if (!local_8.ToLower().Contains("root") && (item_0.Type == RawInputDeviceType.MOUSE || item_0.Type == RawInputDeviceType.HID)) { RegistryKey local_9 = WinRawMouse.FindRegistryKey(local_8); string local_10 = (string)local_9.GetValue("DeviceDesc"); string local_11 = (string)local_9.GetValue("Class"); string local_10_1 = local_10.Substring(local_10.LastIndexOf(';') + 1); if (!string.IsNullOrEmpty(local_11) && local_11.ToLower().Equals("mouse") && !this.rawids.ContainsKey(new ContextHandle(item_0.Device))) { RawInputDeviceInfo local_12 = new RawInputDeviceInfo(); int local_13 = API.RawInputDeviceInfoSize; Functions.GetRawInputDeviceInfo(item_0.Device, RawInputDeviceInfoEnum.DEVICEINFO, local_12, out local_13); WinRawMouse.RegisterRawDevice(this.Window, local_10_1); this.mice.Add(new MouseState() { IsConnected = true }); this.names.Add(local_10_1); this.rawids.Add(new ContextHandle(item_0.Device), this.mice.Count - 1); } } } } } }
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); }
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); }