Esempio n. 1
0
        private void ProcessRawInput(IntPtr wParam)
        {
            RAWINPUT rawInput = new RAWINPUT();
            int      length   = Marshal.SizeOf(typeof(RAWINPUT));

            int result = GetRawInputData(wParam, RawInputCommand.Input, out rawInput, ref length,
                                         Marshal.SizeOf(typeof(RAWINPUTHEADER)));

            if (result != 1)
            {
                if (rawInput.Header.Type == RawInputType.Keyboard)
                {
                    if ((rawInput.Keyboard.Flags == 0))
                    {
                        RawInputEvent(new RawInputEventArgs(rawInput.Keyboard.VirtualKey, false));
                    }
                    if ((rawInput.Keyboard.Flags & 1) != 0)
                    {
                        RawInputEvent(new RawInputEventArgs(rawInput.Keyboard.VirtualKey, true));
                    }
                }
            }
        }
Esempio n. 2
0
        private void ProcessRawInput(IntPtr wParam)
        {
            RAWINPUT rawInput = new RAWINPUT();
            int length = Marshal.SizeOf(typeof(RAWINPUT));

            int result = GetRawInputData(wParam, RawInputCommand.Input, out rawInput, ref length,
                                         Marshal.SizeOf(typeof(RAWINPUTHEADER)));

            if (result != 1)
            {
                if (rawInput.Header.Type == RawInputType.Keyboard)
                {
                    if ((rawInput.Keyboard.Flags == 0))
                    {
                        RawInputEvent(new RawInputEventArgs(rawInput.Keyboard.VirtualKey, false));
                    }
                    if ((rawInput.Keyboard.Flags & 1) != 0)
                    {
                        RawInputEvent(new RawInputEventArgs(rawInput.Keyboard.VirtualKey, true));
                    }
                }
            }
        }
Esempio n. 3
0
 private static extern int GetRawInputData(IntPtr hRawInput,
                                           RawInputCommand uiCommand, out RAWINPUT pData,
                                           ref int pcbSize, int cbSizeHeader);
Esempio n. 4
0
 private static extern int GetRawInputData(IntPtr hRawInput,
                                           RawInputCommand uiCommand, out RAWINPUT pData,
                                           ref int pcbSize, int cbSizeHeader);