Skip to main content

press_key

Function press_key 

Source
pub async fn press_key(c: &BidiClient, ctx: &str, chord: &Chord) -> Result<()>
Expand description

Press and release a key, with any modifiers held around it.

BiDi tracks modifier state from the keyDown/keyUp pairs itself, so unlike CDP there is no bitmask — the nesting order is the state. Modifiers are released in reverse for the same reason as CDP: a key left down leaks into whatever the page does next.

input.releaseActions runs afterwards regardless, so a failed action sequence cannot strand the browser with a modifier held.