minicrossterm/examples
Michael Davis bca71adad7
Implement "report alternate keys" from the Kitty Keyboard Protocol (#754)
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.
2023-02-11 10:40:11 +01:00
..
interactive-demo Add SetCursorStyle command (#742) 2023-01-11 21:04:02 +01:00
event-match-modifiers.rs Add bracketed paste parsing (#693) 2022-08-10 09:16:56 +02:00
event-poll-read.rs Fix typos (#675) 2022-06-06 18:10:06 +02:00
event-read-char-line.rs Replace AnsiType with write_ansi (#523) 2020-12-28 07:56:32 +01:00
event-read.rs Implement "report alternate keys" from the Kitty Keyboard Protocol (#754) 2023-02-11 10:40:11 +01:00
event-stream-async-std.rs Remove Unneeded Imports (#552) 2021-03-28 13:49:38 +02:00
event-stream-tokio.rs Remove Unneeded Imports (#552) 2021-03-28 13:49:38 +02:00
is_tty.rs 0.24 (#686) 2022-07-02 21:39:25 +02:00
README.md Fix typos (#675) 2022-06-06 18:10:06 +02:00
stderr.rs Addes documentation to examples (#348) 2019-12-16 10:13:35 -06:00

Lines of Code MIT Join us on Discord

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.