src/global/structs/keyaction.rs
49 lines · 1370 bytes
1use serde::{Deserialize, Serialize};
2
3/// Part of the keybindings config
4// Each key + modifier is bind to a key in a HashMap<KeyCode, HashMap<u8, KeyAction>>
5#[derive(Serialize, Deserialize, Clone, Copy, PartialEq, Eq, Debug)]
6pub enum KeyAction {
7 /// Moves cursor to the left direction, or to the first item
8 MoveLeft,
9 /// Moves cursor to the right direction, or to the last item
10 MoveRight,
11 /// Moves cursor up
12 MoveUp,
13 /// Moves cursor dowm
14 MoveDown,
15 /// select the current item
16 Select,
17 /// deselect the current item, reverts the cursor back to its hover state
18 Deselect,
19 /// exits/quits the entire app
20 Exit,
21 /// revert last history
22 Back,
23 /// removes all history
24 ClearHistory,
25 /// reverts back to first history (home page if it is not cleared)
26 FirstHistory,
27 /// reload the current page
28 Reload,
29 /// start command capture
30 StartCommandCapture,
31 /// paste text
32 Paste,
33 /// remove a word
34 RemoveWord,
35 /// removes all content in textfield
36 ClearLine,
37 /// move cursor to previous word in textfield
38 PreviousWord,
39 /// move cursor to next word in textfield
40 NextWord,
41 /// move cursor to the first position
42 First,
43 /// move cursor to the last position
44 End,
45 /// Previous entry
46 PreviousEntry,
47 /// Next entry
48 NextEntry,
49}