workflow_terminal/keys.rs
1//!
2//! Terminal key definitions
3//!
4
5#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
6/// A key press received from the terminal, normalized across platforms.
7pub enum Key {
8 /// The Enter (Return) key.
9 Enter,
10 /// The Backspace key, deleting the character before the cursor.
11 Backspace,
12 /// The Left arrow key.
13 ArrowLeft,
14 /// The Right arrow key.
15 ArrowRight,
16 /// The Up arrow key.
17 ArrowUp,
18 /// The Down arrow key.
19 ArrowDown,
20 /// The Home key.
21 Home,
22 /// The End key.
23 End,
24 /// The Page Up key.
25 PageUp,
26 /// The Page Down key.
27 PageDown,
28 /// A Shift+Tab (back-tab) press, moving focus backward.
29 BackTab,
30 /// The Delete key, deleting the character at the cursor.
31 Delete,
32 /// The Insert key.
33 Insert,
34 /// A printable character key.
35 Char(char),
36 /// A character pressed together with the Alt modifier.
37 Alt(char),
38 /// A character pressed together with the Ctrl modifier.
39 Ctrl(char),
40 /// The Escape key.
41 Esc,
42}