Skip to content

Conversation

Coquinate
Copy link
Contributor

Summary

Adds a new press_key tool that enables keyboard input automation, supporting both single keys and key combinations with modifiers.

Features

  • Single key press (e.g., "Enter", "Escape", "Tab", "ArrowLeft")
  • Key combinations with modifiers (e.g., "Control+A", "Control+Shift+T")
  • Edge case handling (e.g., "Control++" for plus key with modifier)

Implementation

  • Added splitKeyCombo() helper function to parse key combinations
  • Supports modifier keys: Control, Shift, Alt, Meta
  • Presses modifiers in order, releases in reverse order
  • Includes comprehensive tests covering all scenarios
  • Updated documentation (tool count: 26 → 27)

Test Results

All tests passing:

  • ✅ Single key press
  • ✅ Key combinations
  • ✅ Plus key with modifier edge case
  • ✅ Multiple modifiers

Test Plan

  • Build succeeds
  • All existing tests pass
  • New press_key tests pass
  • Documentation generated correctly

Add WebP format to screenshot tool, providing superior compression
compared to JPEG. Also fixes bug where saveTemporaryFile always
saved files with .png extension regardless of format.
Add press_key tool that supports single keys and key combinations with modifiers.

Features:
- Single key press (e.g., "Enter", "Escape", "Tab")
- Key combinations with modifiers (e.g., "Control+A", "Control+Shift+T")
- Edge case handling (e.g., "Control++" for plus key with modifier)

Implementation:
- Added splitKeyCombo() helper function to parse key combinations
- Handles modifier keys: Control, Shift, Alt, Meta
- Presses modifiers in order, releases in reverse order
- Includes comprehensive tests for all scenarios
- Updated documentation with 27 tools (was 26)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants