'How can we send touchpad events into webview page
I am trying to drag a canvas on an webpage created with qooxdoo. (EA CnCTA Game). Android webview can scroll fine. The webpage however isn't recieving mouse movement events. If the webpage canvas is larger that the viewport I can only move the webview itself but I can't drag the page to it's ends.
If the webview is 100x100 an the webpage is 1000x1000. The webpage is to large to be zoomed out an fill the viewport. I am stuck to viewing only the 100x100 part of the webpage, I can't access the rest. I can send DPAD key events manually by creating buttons on top of the webview and set click listeners
dpadL.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View view)
{
dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DPAD_LEFT));
dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DPAD_LEFT));
}
});
The problem with doing this is that the canvas moves slow and I can't stop the keypress event. It keeps on moving through the webpage area.
I want to send mouse events like a desktop would leftclick on to a mouse and move the canvas by dragging.
I am thinking of creating a transparent LinearLayout to act as a mouse. But I don't know what events simulate the actof left mouse click and dragging the canvas and what to send to the webview. I also thinking maybe the events need to be sent to webview as JavaScript so that the page can handle the events but I still don't know what events to send to webview JavaScript
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
