Implement Hash for input event types (#157)
This commit is contained in:
parent
0f1e275216
commit
59796130fa
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user