Handling input from a keyboard wedge
Asked Answered
C

1

0

Following on from the question asked by Mykroft

Best way to handle input from a keyboard “wedge”

Best way to handle input from a keyboard "wedge".

I need to write a class that intercepts key strokes, if the input is determined to be from the keyboard wedge (as described in the above post) the data will be directed to POS classes to handle, otherwise they keystrokes must be passed on to be handled in windows in the normal manner. This raises two questions

  1. How can I intercept key strokes when not in a WinForm.

  2. How can I pass on the keypresses to windows.

Thanks JDibble

Continuative answered 8/11, 2008 at 15:46 Comment(0)
W
1

You'll need to P/Invoke SetWindowsHookEx(). The only hook that will work in a .NET app is WH_KEYBOARD_LL. You should get loads of hits on example code when you Google these keywords.

Willard answered 8/11, 2008 at 19:18 Comment(1)
The P/Invoke SetWindowsHookEx() approach allows me to collect key strokes perfectly, and pass them on to my classes. Just ned to work on re-sending them to windows if they are determined not to be from the keyboard wedge device.Continuative

© 2022 - 2024 — McMap. All rights reserved.