bracket_terminal/input/
event_queue.rs

1pub use crate::prelude::VirtualKeyCode;
2pub use bracket_geometry::prelude::Point;
3
4/// Available device events
5#[derive(Clone, Debug, PartialEq)]
6pub enum BEvent {
7    /// The window was resized
8    Resized {
9        new_size: Point,
10        dpi_scale_factor: f32,
11    },
12
13    /// The window was moved
14    Moved { new_position: Point },
15
16    /// The window has requested that it be closed
17    CloseRequested,
18
19    /// A character was input
20    Character { c: char },
21
22    /// The window gained or lost focus
23    Focused { focused: bool },
24
25    /// The mouse cursor entered the window
26    CursorEntered,
27
28    /// The mouse cursor left the window
29    CursorLeft,
30
31    /// The mouse cursor moved
32    CursorMoved { position: Point },
33
34    /// A mouse button was pressed or released
35    MouseClick { button: usize, pressed: bool },
36
37    /// Mouse button is down
38    MouseButtonDown { button: usize },
39
40    /// Mouse button is up
41    MouseButtonUp { button: usize },
42
43    /// A key on the keyboard was pressed or released.
44    KeyboardInput {
45        key: VirtualKeyCode,
46        scan_code: u32,
47        pressed: bool,
48    },
49
50    /// The window's scale factor was changed. You generally don't need to do anything for this, unless you are working with
51    /// pixel coordinates.
52    ScaleFactorChanged {
53        new_size: Point,
54        dpi_scale_factor: f32,
55    },
56}