protected RawInput(IntPtr handle, RawInputCaptureMode captureMode) { RawInputDevice[] array = { new RawInputDevice { UsagePage = HidUsagePage.GENERIC, Usage = HidUsage.Keyboard, Flags = (captureMode == RawInputCaptureMode.Foreground ? RawInputDeviceFlags.NONE : RawInputDeviceFlags.INPUTSINK) | RawInputDeviceFlags.DEVNOTIFY, Target = IntPtr.Zero }, new RawInputDevice { UsagePage = HidUsagePage.GENERIC, Usage = HidUsage.Mouse, Flags = (captureMode == RawInputCaptureMode.Foreground ? RawInputDeviceFlags.NONE : RawInputDeviceFlags.INPUTSINK) | RawInputDeviceFlags.DEVNOTIFY, Target = IntPtr.Zero }, new RawInputDevice { UsagePage = HidUsagePage.GENERIC, Usage = HidUsage.Gamepad, Flags = (captureMode == RawInputCaptureMode.Foreground ? RawInputDeviceFlags.NONE : RawInputDeviceFlags.INPUTSINK) | RawInputDeviceFlags.DEVNOTIFY, Target = IntPtr.Zero } }; if (!Win32Methods.RegisterRawInputDevices(array, (uint)array.Length, (uint)Marshal.SizeOf(array[0]))) { throw new ApplicationException("Failed to register raw input device(s).", new Win32Exception()); } EnumerateDevices(); _devNotifyHandle = RegisterForDeviceNotifications(handle); }
public RawFormsInput(IWin32Window window, RawInputCaptureMode captureMode) : this(window.Handle, captureMode) { }
public RawFormsInput(IntPtr parentHandle, RawInputCaptureMode captureMode) : base(parentHandle, captureMode) { _window = new RawInputNativeWindow(this, parentHandle); }
public RawPresentationInput(Visual visual, RawInputCaptureMode captureMode) : this(GetHwndSource(visual), captureMode) { }
public RawPresentationInput(HwndSource hwndSource, RawInputCaptureMode captureMode) : base(hwndSource.Handle, captureMode) { hwndSource.AddHook(Hook); }
protected RawInput(IntPtr handle, RawInputCaptureMode captureMode) { _keyboardDriver = new RawKeyboard(handle, captureMode == RawInputCaptureMode.Foreground); }
public RawPresentationInput(IntPtr hwnd, RawInputCaptureMode captureMode) : base(hwnd, captureMode) { HwndSource.FromHwnd(hwnd).AddHook(Hook); }