Hi,
Is there is any simple way to read binary stream from /dev/input/event file (e.g mouse event) without any extra libs (like input_event)? Just with loop + File.open
and (?) IO.binstream for example. I have tried different IO functions but without success.
I have equivalent snippet in golang
:
func main() {
buff := make([]byte, 64)
f, err := os.Open("/dev/input/event5")
if err != nil {
panic(err)
}
defer f.Close()
for {
fmt.Println(f.Read(buff))
}
}
Thanks!