Skip to main content

ordered

Function ordered 

Source
pub fn ordered(
    released: &[Key],
    pressed: &[Key],
    down: impl Fn(Key) -> bool,
    shift: bool,
) -> Vec<RawInputEvent>
Expand description

A frame’s key events in the order they happened, from what the window says of the frame: the keys released and pressed in it, and whether a key is down at its end. Releases come first (a key let go, then another pressed), then presses (with shift). A key both pressed and released in one frame was tapped if it is up at the end (pressed, then let go: its release comes after its press), or let go and pressed again if it is down; so a quick tap never reads as a key held down, which would repeat its action until the next release.