Expand description
Key definitions and chord parsing, shared by both engines.
CDP and BiDi name keys in different namespaces: CDP wants
KeyboardEvent.key ("ArrowDown") plus a Windows virtual key code, while
BiDi wants the WebDriver normalised key values (\u{E015} for ArrowDown).
Neither is derivable from the other, so a KeyDef carries both rather
than converting at the call site.
Scope is the US layout: named keys, the modifiers, and printable ASCII.
Anything beyond that belongs in type, which goes through
Input.insertText and is layout-independent.
Structs§
- Chord
- A key plus the modifiers held while it is pressed.
- KeyDef
- Everything both engines need to press one key.
Enums§
- Modifier
- CDP modifier bitmask values. The mask goes on every event in a chord,
including the target key’s — leaving it off there is the usual reason
Control+Aselects nothing.
Constants§
- ENTER
- The
Enterdefinition, sopress_enterkeeps its exact wire payload.
Functions§
- lookup
- Look up one key by name. Named keys are case-insensitive; a single
character is taken literally, so
"a"and"A"differ. - parse_
chord - Parse
"Control+Shift+K". The last segment is the key; the rest are modifiers. A trailing+means the+key, as in"Control++".