playwright-browser-press-key

To press a keyboard key in the page, send a key press for shortcuts or input behavior.

⭐6stars🔀3forks📁View on GitHub🕐Updated Jan 7, 2026

When & Why to Use This Skill

The playwright-browser-press-key Claude skill enables AI agents to simulate precise keyboard interactions within a web browser. By supporting both character inputs and functional shortcuts (like Arrow keys or Enter), it empowers agents to navigate complex user interfaces, trigger event-driven web elements, and automate workflows that require more than just mouse clicks. This tool is a cornerstone for robust web automation, ensuring seamless interaction with modern, dynamic web applications.

Use Cases

  • Keyboard Shortcuts: Execute web-based shortcuts such as 'Enter' to submit forms, 'Escape' to close modals, or 'Tab' to navigate through interactive elements.
  • Dynamic Page Navigation: Control scrolling and navigation on media-heavy sites using 'Arrow' keys or 'PageUp/PageDown' for efficient data browsing.
  • Interactive UI Testing: Automate QA testing for accessibility and keyboard-only navigation to ensure web applications meet usability standards.
  • Complex Input Handling: Interact with custom web components, such as dropdowns or search bars, that require specific key events to trigger search results or selection menus.
nameplaywright-browser-press-key
description"To press a keyboard key in the page, send a key press for shortcuts or input behavior."

Usage

Use the MCP tool dev-swarm.request to send the payload as a JSON string:

{"server_id":"playwright","tool_name":"browser_press_key","arguments":{}}

Tool Description

Press a key on the keyboard

Arguments Schema

The schema below describes the arguments object in the request payload.

{
  "type": "object",
  "properties": {
    "key": {
      "type": "string",
      "description": "Name of the key to press or a character to generate, such as `ArrowLeft` or `a`"
    }
  },
  "required": [
    "key"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

Background Tasks

If the tool returns a task id, poll the task status via the MCP request tool:

{"server_id":"playwright","method":"tasks/status","params":{"task_id":"<task_id>"}}