i want to simulate mouse movement in java but in such a way that i can control the dots moved by my mouse and not the pixels on the screen like the class Robot can do.
So if i change my sensitivity and move 400 dots the pixels my mouse moved should be different then before i changed my sensitivtiy
anyone has an idea how do do that?
tnx in advance
simulating mouse movement in java
Started by ViZon, Mar 26 2010 05:59 AM
2 replies to this topic
#1
Posted 26 March 2010 - 05:59 AM
|
|
|
#2
Posted 26 March 2010 - 09:23 AM
What kind of dots are you talking about?
Mouse moves on pixels.
Mouse moves on pixels.
#3
Posted 27 March 2010 - 04:24 PM
He means DPI I think. If so, you can write a simple math equation to divide the resolution in which the code will run on by your current resolution(the one you are currently working on) and multiply the result by your desired moving pixel
eg: My computer resolution is 800x600
eg: Another computer resoltion is 1024x796
Say i want to move the mouse 100 pixels,50 pixels on my 800x600..Its will be simple because i won't need the equation, But what if i want to move it on the other computer which has 1024x796 monitor. I will simple do that equation
(1024/800)*100 for x-axis
(600/796)*50 for y-axis
eg: My computer resolution is 800x600
eg: Another computer resoltion is 1024x796
Say i want to move the mouse 100 pixels,50 pixels on my 800x600..Its will be simple because i won't need the equation, But what if i want to move it on the other computer which has 1024x796 monitor. I will simple do that equation
(1024/800)*100 for x-axis
(600/796)*50 for y-axis


Sign In
Create Account

Back to top









