Skip to main content

shortcut

Function shortcut 

pub fn shortcut(
    conventions: PlatformConventions,
    character: &str,
    command: bool,
    shift: bool,
) -> Option<UndoRequest>
Expand description

Which history verb, if any, a command-modified character key means.

Both the live host (App) and the headless FrameHarness resolve the key through this, so an app driven by a test scenario undoes on the same keystroke the user’s fingers do. The binding itself is the host-shortcut table in platform. character is winit’s logical key text; shift is read from the modifier state rather than from the character’s case, because a shifted “z” arrives as "Z" on some layouts and "z" on others.

Returns None when the key is not a history binding — including when the command modifier is not held.