An interface implemented by a webview if it supports separate KeyDown()
and KeyUp()
methods.
// Dispatch ctrl + shift + right arrow
await webViewPrefab.WaitUntilInitialized();
var webViewWithKeyDownAndUp = webViewPrefab.WebView as IWithKeyDownAndUp;
if (webViewWithKeyDownAndUp != null) {
webViewWithKeyDownAndUp.KeyDown("ArrowRight", KeyModifier.Control | KeyModifier.Shift);
webViewWithKeyDownAndUp.KeyUp("ArrowRight", KeyModifier.Control | KeyModifier.Shift);
}
void KeyDown(string key, KeyModifier modifiers)
Dispatches a key down event to the webview.
A key can either be a single character representing a unicode character (e.g. "A", "b", "?") or a JavaScript Key value (e.g. "ArrowUp", "Enter").