Reputation: 325
I need to get mouse coordinates with just hovering the usb mouse above my app's view.
the function public boolean onTouchEvent(MotionEvent event) {
only works when I actually click the mouse.
any way to do it? thanks!
Upvotes: 1
Views: 159
Reputation: 93561
Try to set an OnHoverListener via setOnHoverListener. Its mainly meant for styluses, but it may work with a mouse as well.
Upvotes: 2
Reputation: 27
As far as the emulator knows, there's no such thing as a mouse. I'm assuming you want this for testing purposes, but as far as the emulator is concerned, you're basically asking the device to track your finger without touching the screen.
Upvotes: 0