mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 19:17:10 +00:00
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:
1 parent
4b7a3878ac
commit
da3cc5f68c
12 files changed
+106
-10
No files matched your search
@@ -664,12 +664,15 @@ func (d *Driver) runnerTyper() transport.TextTyper {
|
||||
}
|
||||
|
||||
// pressKeyUsage maps the logical key names mobile runs emit to a HID usage.
|
||||
// Only Return/Enter has a hardware-keyboard equivalent on the simulator; other
|
||||
// names (notably "back" and "home") have no HID key and report unsupported.
|
||||
// Return/Enter and Escape are the hardware-keyboard keys the simulator has;
|
||||
// other names (notably "back" and "home") have no HID key and report
|
||||
// unsupported.
|
||||
func pressKeyUsage(key string) (uint32, bool) {
|
||||
switch key {
|
||||
case "enter", "return", "Enter", "Return":
|
||||
return usageReturn, true
|
||||
case "escape", "Escape":
|
||||
return usageEscape, true
|
||||
default:
|
||||
return 0, false
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user