Hello Everyone,
How would I get a data stream from a USB keyboard in Java?
I would assume that I would need to access some sort of native API correct?
Basically what I want to do is get a stream to the raw data coming from the keyboard or any other USB device. I also want to be able to poll whether or not the buffer has data ready to be read, that way when some data some through, I can read the stream. This eliminates read the stream every so often(like every second or so).
I have no experience at interoperating with native API's in java, but I know how to work with raw bytes and the like.
I can't use some external libary such as JSR80 or jUSB. I read on another post(https://community.oracle.com/thread/2255664?start=0&tstart=0) that the OP used javax.comm to access USB / Serial devices. However, I can't seem to find the comm package. I also can't compile C/C++ code so writing an interface that uses JNI is also out of the question. If as a last resort I absolutly can't do this with the standard jdk libaries, then can someone please post the jUSB libary because my ISP restrictions don't allow me to access the site to get it.
I am running java SE 8 on Windows 7 Ultimate x64. I am using Netbeans 8.0.2 for my IDE
Any example code is very helpful!
Thanks for your help in advance,
MasterCodeon