Skip to main content
Issues a single key press. Use + to combine modifiers, e.g. Meta+Enter, Control+Shift+P. Reach for press when a flow depends on the keyboard: submitting a form with Enter, dismissing a dialog with Escape, or running an app’s keyboard shortcuts. To hold a key across several steps, use keyDown and keyUp instead.

Parameters

Shorthand

Key name as a single string.

Examples

Submit a login form without clicking the button:
Close a modal with the keyboard: