I have two USB keyboards plugged into the same machine. I am developing a Java application. Is there anyway to allow the Java Application to separate out which USB keyboard it came from? (I.e. is there something like http://docs.oracle.com/javase/6/docs/api/java/awt/event/KeyEvent.html but with a USB parameter so I can know which USB device it came from?)
Thanks!
This is not possible with Java alone.
But there are 3rd party tools that can remap the keys of a keyboard. HID macros is one application. But it only works with key presses, not key-up and -down events. This limits it’s usefulness but might be enough for your usecase.
If you want to dig deeper you need to use the RAW Input API on Windows to do what you want. There’s already a nice example on code project titled Using Raw Input from C# to handle multiple keyboards that sheds some light on the correct API usage.