Exemple #1
0
        public CRawInput(IntPtr parentHandle, bool captureOnlyInForeground)
        {
            AssignHandle(parentHandle);

            _keyboardDriver = new RawKeyboard(parentHandle, captureOnlyInForeground);
            _keyboardDriver.EnumerateDevices();
            _devNotifyHandle = RegisterForDeviceNotifications(parentHandle);
        }
Exemple #2
0
        public CRawInput(IntPtr parentHandle, bool captureOnlyInForeground)
        {
            AssignHandle(parentHandle);

            _keyboardDriver = new RawKeyboard(parentHandle, captureOnlyInForeground);
            _keyboardDriver.EnumerateDevices();
            _devNotifyHandle = RegisterForDeviceNotifications(parentHandle);
        }
Exemple #3
0
        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);
        }