Scoopta Scoopta - 6 months ago 45
Java Question

Reading /dev/input/js0 from Java

I'm trying to read

from Java but I keep getting Invalid argument
at Method)
at Test.main(

My code is


final class Test {
public static final void main(String[] args) {
try {
FileInputStream in = new FileInputStream("/dev/input/js0");
} catch(IOException e) {

My end goal is to be able to read input from my controller but I can't even seem to read one byte. What am I doing wrong? My user does have read and write access to the file.


Changing the FileInputStream to a BufferedInputStream seems to fix the issue.