IWithPointerDownAndUp

interface

Namespace: Vuplex.WebView

An interface implemented by a webview if it supports PointerDown() and PointerUp(), which can be used to implement functionality like drag interactions, double-clicks, and right-clicks.

Example

var webViewWithPointerDownAndUp = webViewPrefab.WebView as IWithPointerDownAndUp;
if (webViewWithPointerDownAndUp != null) {
    // Double right click at (250px, 100px) in the web page.
    var normalizedPoint = new Vector2(250, 100) / webViewPrefab.WebView.SizeInPixels;
    var pointerOptions = new PointerOptions {
        Button = MouseButton.Right,
        ClickCount = 2
    };
    webViewWithPointerDownAndUp.PointerDown(normalizedPoint, pointerOptions);
    webViewWithPointerDownAndUp.PointerUp(normalizedPoint, pointerOptions);
}

Important note

The Android Gecko plugin doesn't support double clicks.

Summary

Public methods

PointerDown

void PointerDown(Vector2 point)

Dispatches a pointerdown / mousedown click event. This can be used in conjunction with IWithMovablePointer.MovePointer and PointerUp to implement drag interactions.

The x and y components of the point are values in the range of [0, 1] that are normalized to the webview's width and height. For example, point.x = xInPixels / webView.SizeInPixels.x. Like in the browser, the origin is in the upper-left corner, the positive direction of the y-axis is down, and the positive direction of the x-axis is right.

PointerDown

void PointerDown(Vector2 point, PointerOptions options)

Like PointerDown(Vector2), except it also accepts a PointerOptions parameter to modify the behavior (e.g. to trigger a right click or a double click).

PointerUp

void PointerUp(Vector2 point)

Dispatches a pointerup / mouseup click event. This can be used in conjunction with PointerDown and IWithMovablePointer.MovePointer and to implement drag interactions.

The x and y components of the point are values in the range of [0, 1] that are normalized to the webview's width and height. For example, point.x = xInPixels / webView.SizeInPixels.x. Like in the browser, the origin is in the upper-left corner, the positive direction of the y-axis is down, and the positive direction of the x-axis is right.

PointerUp

void PointerUp(Vector2 point, PointerOptions options)

Like PointerUp(Vector2), except it also accepts a PointerOptions parameter to modify the behavior (e.g. to trigger a right click or a double click).