I'm creating an Android App for a TV platform with a webview, and I'm trying to provide a mouse mode where the user can move a cursor around with the DPAD. Everything up to that works fine so far, but I cannot figure out how to click in the webview. I'm trying to send a MotionEvent:
MotionEvent downEvent = MotionEvent.obtain(SystemClock.uptimeMillis(), SystemClock.uptimeMillis(), MotionEvent.ACTION_DOWN, xPosition, yPosition, 0);
downEvent.setSource(InputDevice.SOURCE_MOUSE);
mWebView.dispatchTouchEvent(downEvent);
But the webview seems to view it as a hover event and the link or whatever is just highlighted instead of clicked.
Any idea what I'm doing wrong?