diff --git a/crossterm_input/src/input/mod.rs b/crossterm_input/src/input/mod.rs index 2fc937a..4476b8d 100644 --- a/crossterm_input/src/input/mod.rs +++ b/crossterm_input/src/input/mod.rs @@ -50,7 +50,7 @@ trait ITerminalInput { } /// Enum to specify which input event has occurred. -#[derive(Debug, PartialOrd, PartialEq)] +#[derive(Debug, PartialOrd, PartialEq, Hash)] pub enum InputEvent { /// A single key or a combination is pressed. Keyboard(KeyEvent), @@ -63,7 +63,7 @@ pub enum InputEvent { } /// Enum to specify which mouse event has occurred. -#[derive(Debug, PartialOrd, PartialEq)] +#[derive(Debug, PartialOrd, PartialEq, Hash)] pub enum MouseEvent { /// A mouse press has occurred, this contains the pressed button and the position of the press. Press(MouseButton, u16, u16), @@ -76,7 +76,7 @@ pub enum MouseEvent { } /// Enum to define mouse buttons. -#[derive(Debug, PartialOrd, PartialEq)] +#[derive(Debug, PartialOrd, PartialEq, Hash)] pub enum MouseButton { /// Left mouse button Left, @@ -91,7 +91,7 @@ pub enum MouseButton { } /// Enum with different key or key combinations. -#[derive(Debug, PartialOrd, PartialEq, Eq, Clone, Copy)] +#[derive(Debug, PartialOrd, PartialEq, Eq, Clone, Copy, Hash)] pub enum KeyEvent { Backspace, Left,