The "report alternate keys" part of the Kitty keyboard protocol will
send an additional codepoint containing the "shifted" version of a
key based on the keyboard layout. This is useful for downstream
applications which set up keybindings based on symbols instead of
exact keys being pressed.
For example, underscore (_) with the Alt modifier is sent as minus (-)
with Alt and Shift modifiers. A terminal will send the underscore
codepoint as an alternate though, and we can use that information and
the presence of the Shift modifier to resolve the symbol. Other
examples are 'A-(' (sent as 'A-S-9') and 'A-)' (sent as 'A-S-0').
This change allows pushing the "report alternate keys" flag and
overwrites the keycode and modifiers for any shifted keys sent by the
terminal.
|
||
|---|---|---|
| .. | ||
| interactive-demo | ||
| event-match-modifiers.rs | ||
| event-poll-read.rs | ||
| event-read-char-line.rs | ||
| event-read.rs | ||
| event-stream-async-std.rs | ||
| event-stream-tokio.rs | ||
| is_tty.rs | ||
| README.md | ||
| stderr.rs | ||
Crossterm Examples
The examples are compatible with the latest release.
Structure
├── examples
│ └── interactive-test
│ └── event-*
│ └── stderr
| File Name | Description | Topics |
|---|---|---|
examples/interactive-test |
interactive, walk through, demo | cursor, style, event |
event-* |
event reading demos | (async) event reading |
stderr |
crossterm over stderr demo | raw mode, alternate screen, custom output |
is_tty |
Is this instance a tty ? | tty |
Run examples
$ cargo run --example [file name]
To run the interactive-demo go into the folder examples/interactive-demo and run cargo run.
License
This project is licensed under the MIT License - see the LICENSE.md file for details.