i'm developing an application that simulates a trackpad. I need to get an accurate value of the position at every point in time, but using events just won't do the job.
Since the motion event ACTION_MOVE
"starts" sending events only when i move a bit from the position where ACTION_DOWN
is called, the position will stick there until i move the finger farther away from the starting position.
Also, while reading the data, the position will eventually get stuck for a short time.
Any way to get the position of the touch imperatively, for example, similarly to how one would do on Unity? (Touches[touchIndex].Position
)
Code i used which doesn't do the job:
@Override
public boolean onTouchEvent(MotionEvent event) {
x = event.getX();
y = event.getY();
}