feat: add press_key tool for keyboard input#246
Closed
Coquinate wants to merge 5 commits intoChromeDevTools:mainfrom
Closed
feat: add press_key tool for keyboard input#246Coquinate wants to merge 5 commits intoChromeDevTools:mainfrom
Coquinate wants to merge 5 commits intoChromeDevTools:mainfrom
Conversation
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)
OrKoN
requested changes
Oct 10, 2025
Collaborator
OrKoN
left a comment
There was a problem hiding this comment.
thanks for the PR! left a few comments
- Move splitKeyCombo to src/third_party/playwright/keyboard.ts - Add Playwright LICENSE and README with source attribution - Replace @ts-expect-error with proper KeyInput type casts - Update press_key description to clarify when to use vs fill() - Standardize input tool schema descriptions using uidSchema
Contributor
Author
|
Updated to address feedback - moved keyboard utilities to third_party/playwright with proper attribution, replaced type suppressions with casts, and clarified when to use press_key vs fill(). |
OrKoN
requested changes
Oct 12, 2025
| schema: { | ||
| from_uid: z.string().describe('The uid of the element to drag'), | ||
| to_uid: z.string().describe('The uid of the element to drop into'), | ||
| from_uid: z.string().describe('Element uid to drag'), |
Collaborator
There was a problem hiding this comment.
please revert changes to the descriptions of unrelated tools. Does it make sense to extract the uid schema? I would suggest we revert this part as well.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
press_keytool that enables keyboard input automation, supporting both single keys and key combinations with modifiers.Features
Implementation
splitKeyCombo()helper function to parse key combinationsTest Results
All tests passing:
Test Plan