I am creating a mobile application like the popular keyboard and mouse on Android devices, the problem I face is that the mouse doesn't move normally on the computer screen, I used Java robot class to make that possible the cursor keeps shaking and it's hard to move.
Asked
Active
Viewed 551 times
1 Answers
0
I think you'd want to look at some sort of movement scaling algorithm based on the velocity of the user's finger. If the user moves their finger slowly on the Android device, then the mouse cursor moves slowly (a shorter distance). If the user moves their finger quickly, then the mouse cursor can move quickly across the screen a greater distance.

MCattle
- 2,897
- 2
- 38
- 54
-
thanks alot MCattle but where do i find such things i have been searching for along time, i have found some but they are very complicated and hard to implement, any other ideas? – ahdbarg May 07 '12 at 17:50
-
This is where we fall outside my range of expertise. I don't know the Android APIs for screen swipes, or what information is available in regard to swipe length or velocity. If neither of those are provided, it may be possible to note the timestamp and position of the beginning and end of the swipe, and calculate the velocity. – MCattle May 07 '12 at 18:21
-
1The velocity can be used as a multiplier to the distance to move the mouse on the computer screen, and you can cap the lower end of the velocity scale to not move the mouse cursor at all (removing the jitter), and the upper end of the velocity scale so that the cursor doesn't just slam into the edge of the screen all the time. Beyond that, it's just a matter of trials to see what settings "feel" right, taking into account device and monitor resolutions so that your solution still feels right in different scenarios. – MCattle May 07 '12 at 18:22