Handling input from a keyboard wedge

僤鯓⒐⒋嵵緔 提交于 2020-01-06 07:05:31

问题


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


回答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.



来源:https://stackoverflow.com/questions/274842/handling-input-from-a-keyboard-wedge

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!