Skip to content

fix(browser-operator): add missing win/meta/super key mappings#1868

Open
octo-patch wants to merge 1 commit intobytedance:mainfrom
octo-patch:fix/issue-1843-add-win-key-mapping
Open

fix(browser-operator): add missing win/meta/super key mappings#1868
octo-patch wants to merge 1 commit intobytedance:mainfrom
octo-patch:fix/issue-1843-add-win-key-mapping

Conversation

@octo-patch
Copy link
Copy Markdown

Fixes #1843

Problem

When UI-TARS tries to execute a hotkey involving the Windows key (win), it throws:

Error: Unsupported key: win
    at DefaultBrowserOperator.handleHotkey

This is because win (the Windows Meta key) was not present in KEY_MAPPINGS in key-map.ts. Any hotkey combination using win (e.g., win+d for Show Desktop, win+r for Run dialog) would fail with this error.

Solution

Added the following key aliases to KEY_MAPPINGS:

  • win'Meta' (Windows key on Windows)
  • meta'Meta' (explicit Meta key reference)
  • super'Meta' (Linux/Unix convention for the Super/Windows key)

These all map to Puppeteer's 'Meta' KeyInput, which represents the platform meta key (Windows key on Windows, Command key on macOS).

Testing

The fix can be verified by triggering a hotkey action that uses the win key — the error Unsupported key: win will no longer be thrown, and the key will be correctly mapped to Meta in the browser keyboard event.

The 'win' key (Windows Meta key) was not included in KEY_MAPPINGS,
causing an 'Unsupported key: win' error when UI-TARS tried to execute
hotkeys involving the Windows key. Also adds 'meta' and 'super' as
aliases for cross-platform compatibility.

Fixes bytedance#1843
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 18, 2026

Deploy Preview for tarko canceled.

Name Link
🔨 Latest commit 12708b4
🔍 Latest deploy log https://app.netlify.com/projects/tarko/deploys/69e2e2c9a945550008c09e71

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 18, 2026

Deploy Preview for agent-tars-docs canceled.

Name Link
🔨 Latest commit 12708b4
🔍 Latest deploy log https://app.netlify.com/projects/agent-tars-docs/deploys/69e2e2c9047ce4000823583e

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.

[Bug Report]: 让UItars desktop打开网站并截图时会有这个错误

1 participant