I want to use an optical mouse with the Raspberry PI for indoor positioning for which I want to capture raw mouse data and calculate position from it. This is what I have right now (in Ruby)
File.open("/dev/input/by-id/usb-15d9_USB_OPTICAL_MOUSE-mouse") do |f|
loop do
p f.read(16)
end
end
I can't make sense of the output. It would be of great help if any of you pointed me to a resource explaining how this file is supposed to be interpreted and/or how I can calculate position or displacement from it.
I cannot use xdotool or Xlib because the Raspberry PI won't be running any windowing system.