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.
|
/// 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,
|
||||||
|
Loading…
Reference in New Issue
Block a user