Interaction

Send Key

Simulate a keyboard input event.

Simulate a keyboard input event.

Creates and dispatches synthetic keyboard events (keydown, keypress, and keyup) on the document using the provided key, code, and modifier states (Ctrl, Shift, Alt). The events bubble, are cancelable, and simulate a full keystroke sequence. Sending key 0xD (carriage return) on a button will click the button.

Examples

GPAL Fluent: High-level fluent C# API

browser.SendKey(byte VKCode)

MagicHelper: MagicHelper utility library

GPAL.MagicHelper.SendKey(string key);

Puppeteer Client: Puppeteer-style C# client

//PuppeteerClient.SendKey takes a virtual key code (byte) and internally converts it to the corresponding DOM key and code values.

browser.PuppeteerClient.SendKey(byte vkcode).Execute();

Puppeteer Communicator: Low-level communicator

await browser.PuppeteerCommunicator.SendKey(string key, string code, int vkCode, string sessionId);

REST Client: Direct REST/HTTP client

GPAL.OttoMagicClient.WithEndpoint(ApiEndpoint.SendKey).WithKey(string key).Execute();