Mouse scroll capture (GUI independent under linux)
Hi everyone! I have a problem, I have an app that already capture the mouse movements in not graphical mode, now I badly need it to capture scrolling.
The program was written by a guy that no longer works here, he managed to read the mouse by reading the file /dev/input/mouse0
Code:
public byte[] readMovementPacket() throws IOException
{
byte[] barray = new byte[3];
file.read(barray);
return barray;
}
then with the byte array he composes the information:
Code:
byte[] packet = mouse.readMovementPacket();
if(packet != null)
{
int b7, b6, b5, b4, b3, b2, b1, b0;
b0 = (packet[0] ) & 1;
b1 = (packet[0] >> 1) & 1;
b2 = (packet[0] >> 2) & 1;
b3 = (packet[0] >> 3) & 1;
b4 = (packet[0] >> 4) & 1;
b5 = (packet[0] >> 5) & 1;
b6 = (packet[0] >> 6) & 1;
b7 = (packet[0] >> 7) & 1;
int x, y,z;
x = packet[1];
y = packet[2];
}
Well, now I need to extract scrolling
If anybody knows how to do it, or can redirect me to some place where to find how to do it I'll be very happy ;)