I have two devices, a Barcode-Scanner and a Keyboard, connect over USB to my PC. My goal is to read all the input from the Barcode-Scanner and process this with my program. Furthermore the input of the Scanner should be blocked for the OS.
I found a good article to this topic that is called: Combining Raw Input and keyboard Hook to selectively block input from multiple keyboards
With this approach I can get the input (and from which device this input comes) for my programm and block it for the OS, like I want to. But this approach is pretty complicated because it only works with a combination of inputEvents and Hooks. The Hooks are there for blocking the data for the OS. The problem is that there is no way to tell from which device the Hook comes.
My question is: Does anyone know an other way to block input from a special keyboard that does not work with this combination of inputEvents and Hooks? Or maybe there is a possibility to tell from which device a Hook comes?