Skip to content

computer-use: named keys like Escape produce shift+escape due to upstream robotgo behavior #4417

@rovle

Description

@rovle

Summary

Daytona's computer-use keyboard layer passes key names directly to robotgo.KeyTap. When callers use title-case or uppercase names like Escape, ESC, or ESCAPE, robotgo injects an unwanted shift modifier, so the key event becomes shift+escape instead of plain escape.

This affects any named key whose first character is uppercase.

Root cause

robotgo.KeyTap applies an uppercase-to-shift heuristic before it normalizes key names:

  1. If the first rune of the key string is uppercase, it appends shift
  2. Then it lowercases the string
  3. Then it resolves key aliases

So Escape starts with uppercase E, picks up shift, gets lowered to escape, and the final event is shift+escape.

This heuristic makes sense for printable characters (A should produce shift+a), but it breaks named keys that happen to start with an uppercase letter.

Expected behavior

Named keys should be case-insensitive. All of the following should send plain escape:

  • escape
  • Escape
  • ESC
  • ESCAPE

The shift heuristic should (probably) only kick in for single printable characters like A .

Proposed fix

Normalize key names and aliases to lowercase in the computer-use layer before handing them to robotgo, with single-character inputs being left as-is so that uppercase letters like A still correctly produce shift+a.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions