Mpress
Bun

method

WebView.press

key: string & {} | VirtualKey,
options?: PressOptions
): Promise<void>;

Press a key.

Named keys ("Enter", "Backspace", "ArrowLeft", etc.) map to editing commands where available and resolve when WebContent has processed them. "Escape" and keys with modifiers fall back to raw keyDown/keyUp (no WebKit barrier exists for keyboard events — a following evaluate() serializes).

A single character (e.g. "a") combined with modifiers sends a chord like Cmd+A.

Referenced types

type VirtualKey = 'Enter' | 'Tab' | 'Space' | 'Backspace' | 'Delete' | 'Escape' | 'ArrowLeft' | 'ArrowRight' | 'ArrowUp' | 'ArrowDown' | 'Home' | 'End' | 'PageUp' | 'PageDown'

interface PressOptions