Exemple #1
0
 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);
 }
Exemple #2
0
 public RawFormsInput(IWin32Window window, RawInputCaptureMode captureMode)
     : this(window.Handle, captureMode)
 {
 }
Exemple #3
0
 public RawFormsInput(IntPtr parentHandle, RawInputCaptureMode captureMode)
     : base(parentHandle, captureMode)
 {
     _window = new RawInputNativeWindow(this, parentHandle);
 }
 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);
 }
Exemple #8
0
 public RawPresentationInput(Visual visual, RawInputCaptureMode captureMode) : this(GetHwndSource(visual), captureMode)
 {
 }
Exemple #9
0
 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);
 }
Exemple #11
0
 protected RawInput(IntPtr handle, RawInputCaptureMode captureMode)
 {
     _keyboardDriver = new RawKeyboard(handle, captureMode == RawInputCaptureMode.Foreground);
 }
Exemple #12
0
 public RawPresentationInput(IntPtr hwnd, RawInputCaptureMode captureMode)
     : base(hwnd, captureMode)
 {
     HwndSource.FromHwnd(hwnd).AddHook(Hook);
 }