Implement Hash for input event types (#157)

This commit is contained in:
Luke I. Wilson 2019-06-22 15:12:43 -05:00 committed by Timon
parent 0f1e275216
commit 59796130fa

View File

@ -50,7 +50,7 @@ trait ITerminalInput {
} }
/// Enum to specify which input event has occurred. /// Enum to specify which input event has occurred.
#[derive(Debug, PartialOrd, PartialEq)] #[derive(Debug, PartialOrd, PartialEq, Hash)]
pub enum InputEvent { pub enum InputEvent {
/// A single key or a combination is pressed. /// A single key or a combination is pressed.
Keyboard(KeyEvent), Keyboard(KeyEvent),
@ -63,7 +63,7 @@ pub enum InputEvent {
} }
/// Enum to specify which mouse event has occurred. /// Enum to specify which mouse event has occurred.
#[derive(Debug, PartialOrd, PartialEq)] #[derive(Debug, PartialOrd, PartialEq, Hash)]
pub enum MouseEvent { pub enum MouseEvent {
/// A mouse press has occurred, this contains the pressed button and the position of the press. /// A mouse press has occurred, this contains the pressed button and the position of the press.
Press(MouseButton, u16, u16), Press(MouseButton, u16, u16),
@ -76,7 +76,7 @@ pub enum MouseEvent {
} }
/// Enum to define mouse buttons. /// Enum to define mouse buttons.
#[derive(Debug, PartialOrd, PartialEq)] #[derive(Debug, PartialOrd, PartialEq, Hash)]
pub enum MouseButton { pub enum MouseButton {
/// Left mouse button /// Left mouse button
Left, Left,
@ -91,7 +91,7 @@ pub enum MouseButton {
} }
/// Enum with different key or key combinations. /// 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 { pub enum KeyEvent {
Backspace, Backspace,
Left, Left,