Enum
KeyDecision
#[non_exhaustive]
pub enum KeyDecision {
Default,
Consume,
PageFirst,
}The answer of App::on_key.
Variants
#Default
The key goes on in Kurogane’s order on every OS. A shortcut that closes the window or quits (Ctrl+W, Cmd+Q on macOS) runs before the page sees the key. The page never gets it. Every other shortcut (Ctrl+F, Ctrl+P, Ctrl+R, F5) reaches the page first and runs only if the page does not prevent the key’s default. Kurogane refuses the commands of Chromium’s keys for new tabs and windows (Ctrl+T, Ctrl+N). Those keys reach the page as any key.
#Consume
The key goes nowhere. Neither a shortcut nor the page sees it, its character or its release.
#PageFirst
The key goes to the page first. Its shortcut runs only if the page
does not prevent the key’s default. Under Default
every shortcut but closing and quitting has this order. A page binds
Ctrl+W for itself this way.
For shortcuts only. A key that types a character and is answered
PageFirst types nothing unless the page handles its keydown.
Chromium drops the character of a shortcut the page left alone.
AltGr arrives as Ctrl+Alt on Windows.
The page then decides whether the shortcut runs. One that prevents
Ctrl+W keeps its window open and one that hangs holds the key.
Closing and quitting run before the page so that no page can keep
them. Answer PageFirst only for windows that show the application’s
own pages (KeyPress::browser).
Trait implementations
impl Clone for KeyDecisionimpl Copy for KeyDecisionimpl Debug for KeyDecisionimpl Default for KeyDecisionimpl Eq for KeyDecisionimpl PartialEq for KeyDecision