feat(driver): add escape to the pressKey surface

escape is a key a spec has real use for and no platform could send it. android maps it to KEYCODE_ESCAPE, the ios companion to HID usage 41 and the in-simulator runner to XCUIKeyboardKey.escape, and the Key union accepts it so it can be written at all.
This commit is contained in:
pj committed 2026-08-16 17:41:33 +05:30
1 parent 4b7a3878ac
commit da3cc5f68c
12 files changed
+106 -10

No files matched your search

@@ -336,7 +336,13 @@ func (c *runnerCompanion) PressKey(ctx context.Context, key string) error {
case "enter", "return", "Enter", "Return":
_, err := c.call(ctx, "pressKey", map[string]any{"key": "return"})
return err
case "escape", "Escape":
_, err := c.call(ctx, "pressKey", map[string]any{"key": "escape"})
return err
default:
return fmt.Errorf("runner companion cannot press key %q; only return is supported", key)
return fmt.Errorf(
"runner companion cannot press key %q; only return and escape are supported",
key,
)
}
}