Results 1 to 3 of 3
  1. #1
    DrPete is offline Member
    Join Date
    Mar 2012
    Rep Power

    Question How to control gain between mouse movement and cursor movement ?

    Hello, I want to control the gain between the mouse and the cursor in Java using XP.

    For example, I want to be able to make the cursor move 10 pix when the mouse moves x cm (where x could be 2 cm, or 10 cm, or 20 cm, etc.). I want to use a simple parameter, a multiplier, to do this. I can find the value of the parameter empirically (I can move the mouse x cm and play around with the parameter value until I get the 10 pix of cursor movement).

    I know how to:

    - switch off the Windows mouse accelerator so that the relation between mouse movement and cursor movement is linear.

    I don't know how to:

    - access the mouse position data in the registry (?) and then feed that to the Java cursor via a variable/parameter/multiplier.

    Thanks in advance for any replies

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power

    Default Re: How to control gain between mouse movement and cursor movement ?

    I'm not sure what you're trying is doable, but if it can be done the classes of interest would be MouseInfo, PointerInfo and Robot.

    Last edited by DarrylBurke; 03-09-2012 at 04:10 PM.
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    ozzyman's Avatar
    ozzyman is offline Senior Member
    Join Date
    Mar 2011
    London, UK
    Blog Entries
    Rep Power

    Default Re: How to control gain between mouse movement and cursor movement ?

    I think its possible because there is a Robot.mouseMove(int x, int y) method which moves the mouse pointer to the x,y position you specify.

    Should be a piece of cake, provided there are no security exceptions.

    For example, Robot.mouseMove will actually move the mouse cursor instead of just generating mouse move events.
    Robot (Java Platform SE 7 )
    MouseInfo (Java Platform SE 7 )
    PointerInfo (Java Platform SE 7 )

Similar Threads

  1. Movement
    By elamre in forum Java Applets
    Replies: 24
    Last Post: 01-18-2012, 08:44 PM
  2. Key/mouse movement
    By falkon114 in forum New To Java
    Replies: 3
    Last Post: 02-21-2011, 02:12 AM
  3. Sprite Movement
    By Curtiz in forum Java Gaming
    Replies: 1
    Last Post: 04-26-2010, 01:31 PM
  4. [SOLVED] Using Vectors to Control Movement
    By KingZebulon in forum Advanced Java
    Replies: 4
    Last Post: 12-29-2008, 02:14 AM
  5. Movement of balls
    By BlitzA in forum New To Java
    Replies: 8
    Last Post: 01-09-2008, 03:30 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