Results 1 to 2 of 2
  1. #1
    krimen_sp is offline Member
    Join Date
    Dec 2010
    Posts
    6
    Rep Power
    0

    Default 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

    XML 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:

    XML 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 ;)

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default

    This is not really a Java question - rather its about the format of the contents of /dev/input/mouse0. A brief description of the ImPS/2 format is given in the last post of this thread.

Similar Threads

  1. How to Create Independent copies of a TreeModel
    By xlomo in forum New To Java
    Replies: 3
    Last Post: 05-22-2011, 06:36 PM
  2. Independent Study at College
    By Sno in forum Forum Lobby
    Replies: 2
    Last Post: 10-13-2010, 05:21 PM
  3. Why and how Java is a Platform Independent?
    By gopivista in forum New To Java
    Replies: 7
    Last Post: 09-01-2009, 04:34 PM
  4. Replies: 6
    Last Post: 04-08-2009, 04:05 AM
  5. Mouse Right click option not working in solaris and linux OS
    By dinesh kaushik in forum AWT / Swing
    Replies: 2
    Last Post: 11-21-2007, 04:02 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •