TolikPylypchuk / SharpHook

SharpHook provides a cross-platform global keyboard and mouse hook, event simulation, and text entry simulation for .NET
https://sharphook.tolik.io
MIT License
342 stars 32 forks source link

Is it possible to determine the keyboard device name / id?? #83

Closed fsuk closed 9 months ago

fsuk commented 9 months ago

I want to intercept key events from a barcode reader (serial coms not currently possible) which is emulating keyboard input.

Is it possible to filter keys events somehow to ignore events from the regular keyboard and only handle events from the scanner?

TolikPylypchuk commented 9 months ago

Hi! Thanks for asking! Unfortunately, this is not possible to do with libuiohook, and by extension, SharpHook as well. Here's a related issue from libuiohook.

fsuk commented 9 months ago

Hi! Thanks for asking! Unfortunately, this is not possible to do with libuiohook, and by extension, SharpHook as well. Here's a related issue from libuiohook.

Thanks for your help.

For others intrested after some googling I found this https://www.codeproject.com/Articles/716591/Combining-Raw-Input-and-keyboard-Hook-to-selective

However given the choice between this and getting the serial coms working in MAUI I think I'll give the serial coms a go.