public CRawInput(IntPtr parentHandle, bool captureOnlyInForeground) { AssignHandle(parentHandle); _keyboardDriver = new RawKeyboard(parentHandle, captureOnlyInForeground); _keyboardDriver.EnumerateDevices(); _devNotifyHandle = RegisterForDeviceNotifications(parentHandle); }
public CRawInput(IntPtr parentHandle, bool captureOnlyInForeground) { AssignHandle(parentHandle); _keyboardDriver = new RawKeyboard(parentHandle, captureOnlyInForeground); _keyboardDriver.EnumerateDevices(); _devNotifyHandle = RegisterForDeviceNotifications(parentHandle); }
protected override void WndProc(ref Message message) { switch (message.Msg) { case Win32.WM_INPUT: { _keyboardDriver.ProcessRawInput(message.LParam); } break; case Win32.WM_USB_DEVICECHANGE: { Debug.WriteLine("USB Device Arrival / Removal"); _keyboardDriver.EnumerateDevices(); } break; } base.WndProc(ref message); }