| 1 | |
| 2 | # Crokey Examples |
| 3 | |
| 4 | To run an example, `cd` to its directory then do `cargo run`. |
| 5 | |
| 6 | ## deser_keybindings |
| 7 | |
| 8 | Shows how a set of key-bindings can be read from JSON (might have been TOML, Hjson, YAML, etc.) and the action executed when the user presses the relevant key combination. |
| 9 | |
| 10 | ## print_key |
| 11 | |
| 12 | Shows how a combiner transforms crossterm key events into key combinations. |
| 13 | |
| 14 | The `Combiner` is configured to recognize combinations which aren't normally available, when the terminal supports the Kitty Keyboard protocol. |
| 15 | |
| 16 | When using a combiner, key combinations involving a modifier (ctrl, alt, shift, space) are detected on key release. |
| 17 | |
| 18 | ## print_key_no_combiner |
| 19 | |
| 20 | Similar to print_key, but simpler, uses no `Combiner`. |
| 21 | |
| 22 | Key combinations which are standard on ANSI terminals are handled, but the capabilities of more modern terminals won't be used and you won't get combinations like `ctrl-a-b`, or `space-n`. |
| 23 | |
| 24 | When not using a combiner, all combinations are detected on key press. |