# Enum `kurogane::KeyDecision`

```rust
#[non_exhaustive]
pub enum KeyDecision {
    Default,
    Consume,
    PageFirst,
}
```

The answer of [`App::on_key`](https://kurogane-rs.org/docs/api/app/app.md#method.on_key).

[crate::App::on_key]: https://kurogane-rs.org/docs/api/app/app.md#method.on_key

## Variants

### `Default`

```rust
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`

```rust
Consume
```

The key goes nowhere. Neither a shortcut nor the page sees it, its
character or its release.

### `PageFirst`

```rust
PageFirst
```

The key goes to the page first. Its shortcut runs only if the page
does not prevent the key's default. Under [`Default`](https://kurogane-rs.org/docs/api/requests/keydecision.md#variant.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`]).

[Self::Default]: https://kurogane-rs.org/docs/api/requests/keydecision.md#variant.Default
[`KeyPress::browser`]: https://kurogane-rs.org/docs/api/requests/keypress.md#method.browser

## Trait implementations

- `impl Clone for KeyDecision`
- `impl Copy for KeyDecision`
- `impl Debug for KeyDecision`
- `impl Default for KeyDecision`
- `impl Eq for KeyDecision`
- `impl PartialEq for KeyDecision`

Source: https://github.com/0x48piraj/kurogane/blob/584c586118ee53cc04604007ee038557bd859092/kurogane/src/keys.rs#L223
