Question

How do you get the sensitivity of a mouse, change it, and then apply it to the mouse?

-Progress removed, showed the speed of clicking instead of the speed of moving-

I have researched this "everywhere", but there is nothing on this subject.

Was it helpful?

Solution

First of all I think arg0.getXOnScreen will give You the absolute x coordinate of the mouse, not the old position as You're assuming by defining variable named oldX. getX should give you the position within the panel or (sth like widget i do not know the api you are using). The second thing is... what do You mean 'sensitivity of mouse' Do you want to change global system settings for mouse from java ? I do not think it is even possible. Look here this will require You to add jni lib to project and invoke some native libs, so You make your code platform dependent.

OTHER TIPS

You would probably have to tinker with the Robot class and listnening for mouse events. So you'd have to listen for mouse pressed events and after that use robot to move the mouse 3x more pixels than the mouse is actually moving, then you'd have to do a mouse up event via the Robot class, reposition the mouse to the original position followed by a mouse down event via the robot.

See how this can be problematic? This would be extremely use case driven and not something to do generically. I've been doing Java a long time so I could probably pull it off but it is not something a novice could probably do because other issues would come up that need resolution during the debugging process.

Noticed this thread when dealing with a 3d API that rotates the view WAY TO SLOW.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top