Input.dispatchKeyEvent

Dispatches a key event to the page.

{
  "name": "dispatchKeyEvent",
  "parameters": [
    {
      "name": "type",
      "type": "string",
      "enum": [
        "keyDown",
        "keyUp",
        "rawKeyDown",
        "char"
      ],
      "description": "Type of the key event."
    },
    {
      "name": "modifiers",
      "type": "integer",
      "optional": true,
      "description": "Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0)."
    },
    {
      "name": "timestamp",
      "type": "number",
      "optional": true,
      "description": "Time at which the event occurred. Measured in UTC time in seconds since January 1, 1970 (default: current time)."
    },
    {
      "name": "text",
      "type": "string",
      "optional": true,
      "description": "Text as generated by processing a virtual key code with a keyboard layout. Not needed for for keyUp and rawKeyDown events (default: \"\")"
    },
    {
      "name": "unmodifiedText",
      "type": "string",
      "optional": true,
      "description": "Text that would have been generated by the keyboard if no modifiers were pressed (except for shift). Useful for shortcut (accelerator) key handling (default: \"\")."
    },
    {
      "name": "keyIdentifier",
      "type": "string",
      "optional": true,
      "description": "Unique key identifier (e.g., 'U+0041') (default: \"\")."
    },
    {
      "name": "code",
      "type": "string",
      "optional": true,
      "description": "Unique DOM defined string value for each physical key (e.g., 'KeyA') (default: \"\")."
    },
    {
      "name": "key",
      "type": "string",
      "optional": true,
      "description": "Unique DOM defined string value describing the meaning of the key in the context of active modifiers, keyboard layout, etc (e.g., 'AltGr') (default: \"\")."
    },
    {
      "name": "windowsVirtualKeyCode",
      "type": "integer",
      "optional": true,
      "description": "Windows virtual key code (default: 0)."
    },
    {
      "name": "nativeVirtualKeyCode",
      "type": "integer",
      "optional": true,
      "description": "Native virtual key code (default: 0)."
    },
    {
      "name": "autoRepeat",
      "type": "boolean",
      "optional": true,
      "description": "Whether the event was generated from auto repeat (default: false)."
    },
    {
      "name": "isKeypad",
      "type": "boolean",
      "optional": true,
      "description": "Whether the event was generated from the keypad (default: false)."
    },
    {
      "name": "isSystemKey",
      "type": "boolean",
      "optional": true,
      "description": "Whether the event was a system key event (default: false)."
    }
  ],
  "description": "Dispatches a key event to the page."
}