event: derive Hash
This commit is contained in:
parent
2e775d270f
commit
cc112415c5
@ -3,7 +3,7 @@ use ffi::*;
|
|||||||
use {Event};
|
use {Event};
|
||||||
use super::{Kind, Code};
|
use super::{Kind, Code};
|
||||||
|
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
|
||||||
pub enum Absolute {
|
pub enum Absolute {
|
||||||
Position(Position),
|
Position(Position),
|
||||||
Wheel(Wheel),
|
Wheel(Wheel),
|
||||||
@ -39,7 +39,7 @@ impl Code for Absolute {
|
|||||||
}
|
}
|
||||||
|
|
||||||
custom_derive! {
|
custom_derive! {
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, IterVariants(PositionVariants))]
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, IterVariants(PositionVariants))]
|
||||||
pub enum Position {
|
pub enum Position {
|
||||||
X,
|
X,
|
||||||
Y,
|
Y,
|
||||||
@ -78,7 +78,7 @@ impl Code for Position {
|
|||||||
}
|
}
|
||||||
|
|
||||||
custom_derive! {
|
custom_derive! {
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, IterVariants(WheelVariants))]
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, IterVariants(WheelVariants))]
|
||||||
pub enum Wheel {
|
pub enum Wheel {
|
||||||
Throttle,
|
Throttle,
|
||||||
Rudder,
|
Rudder,
|
||||||
@ -115,7 +115,7 @@ impl Code for Wheel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
custom_derive! {
|
custom_derive! {
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, IterVariants(HatVariants))]
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, IterVariants(HatVariants))]
|
||||||
pub enum Hat {
|
pub enum Hat {
|
||||||
X0,
|
X0,
|
||||||
Y0,
|
Y0,
|
||||||
@ -158,7 +158,7 @@ impl Code for Hat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
custom_derive! {
|
custom_derive! {
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, IterVariants(DigiVariants))]
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, IterVariants(DigiVariants))]
|
||||||
pub enum Digi {
|
pub enum Digi {
|
||||||
Pressure,
|
Pressure,
|
||||||
Distance,
|
Distance,
|
||||||
@ -197,7 +197,7 @@ impl Code for Digi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
custom_derive! {
|
custom_derive! {
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, IterVariants(MultiVariants))]
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, IterVariants(MultiVariants))]
|
||||||
pub enum Multi {
|
pub enum Multi {
|
||||||
Slot,
|
Slot,
|
||||||
TouchMajor,
|
TouchMajor,
|
||||||
|
@ -3,7 +3,7 @@ use ffi::*;
|
|||||||
use {Event};
|
use {Event};
|
||||||
use super::{Kind, Code, Press, Release};
|
use super::{Kind, Code, Press, Release};
|
||||||
|
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
|
||||||
pub enum Controller {
|
pub enum Controller {
|
||||||
All,
|
All,
|
||||||
Misc(Misc),
|
Misc(Misc),
|
||||||
@ -49,7 +49,7 @@ impl Code for Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
custom_derive! {
|
custom_derive! {
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, IterVariants(MiscVariants))]
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, IterVariants(MiscVariants))]
|
||||||
pub enum Misc {
|
pub enum Misc {
|
||||||
_0,
|
_0,
|
||||||
_1,
|
_1,
|
||||||
@ -94,7 +94,7 @@ impl Code for Misc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
custom_derive! {
|
custom_derive! {
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, IterVariants(MouseVariants))]
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, IterVariants(MouseVariants))]
|
||||||
pub enum Mouse {
|
pub enum Mouse {
|
||||||
Left,
|
Left,
|
||||||
Right,
|
Right,
|
||||||
@ -129,7 +129,7 @@ impl Code for Mouse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
custom_derive! {
|
custom_derive! {
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, IterVariants(JoyStickVariants))]
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, IterVariants(JoyStickVariants))]
|
||||||
pub enum JoyStick {
|
pub enum JoyStick {
|
||||||
Trigger,
|
Trigger,
|
||||||
Thumb,
|
Thumb,
|
||||||
@ -183,7 +183,7 @@ impl Code for JoyStick {
|
|||||||
}
|
}
|
||||||
|
|
||||||
custom_derive! {
|
custom_derive! {
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, IterVariants(GamePadVariants))]
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, IterVariants(GamePadVariants))]
|
||||||
pub enum GamePad {
|
pub enum GamePad {
|
||||||
South,
|
South,
|
||||||
A,
|
A,
|
||||||
@ -249,7 +249,7 @@ impl Code for GamePad {
|
|||||||
}
|
}
|
||||||
|
|
||||||
custom_derive! {
|
custom_derive! {
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, IterVariants(DigiVariants))]
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, IterVariants(DigiVariants))]
|
||||||
pub enum Digi {
|
pub enum Digi {
|
||||||
Pen,
|
Pen,
|
||||||
Rubber,
|
Rubber,
|
||||||
@ -307,7 +307,7 @@ impl Code for Digi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
custom_derive! {
|
custom_derive! {
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, IterVariants(WheelVariants))]
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, IterVariants(WheelVariants))]
|
||||||
pub enum Wheel {
|
pub enum Wheel {
|
||||||
GearDown,
|
GearDown,
|
||||||
GearUp,
|
GearUp,
|
||||||
@ -339,7 +339,7 @@ impl Code for Wheel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
custom_derive! {
|
custom_derive! {
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, IterVariants(DPadVariants))]
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, IterVariants(DPadVariants))]
|
||||||
pub enum DPad {
|
pub enum DPad {
|
||||||
Up,
|
Up,
|
||||||
Down,
|
Down,
|
||||||
@ -375,7 +375,7 @@ impl Code for DPad {
|
|||||||
}
|
}
|
||||||
|
|
||||||
custom_derive! {
|
custom_derive! {
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, IterVariants(TriggerHappyVariants))]
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, IterVariants(TriggerHappyVariants))]
|
||||||
pub enum TriggerHappy {
|
pub enum TriggerHappy {
|
||||||
_1,
|
_1,
|
||||||
_2,
|
_2,
|
||||||
|
@ -3,7 +3,7 @@ use ffi::*;
|
|||||||
use {Event};
|
use {Event};
|
||||||
use super::{Kind, Code, Press, Release};
|
use super::{Kind, Code, Press, Release};
|
||||||
|
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
|
||||||
pub enum Keyboard {
|
pub enum Keyboard {
|
||||||
All,
|
All,
|
||||||
Key(Key),
|
Key(Key),
|
||||||
@ -53,7 +53,7 @@ impl Code for Keyboard {
|
|||||||
}
|
}
|
||||||
|
|
||||||
custom_derive! {
|
custom_derive! {
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, IterVariants(KeyVariants))]
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, IterVariants(KeyVariants))]
|
||||||
pub enum Key {
|
pub enum Key {
|
||||||
Reserved,
|
Reserved,
|
||||||
Esc,
|
Esc,
|
||||||
@ -285,7 +285,7 @@ impl Code for Key {
|
|||||||
}
|
}
|
||||||
|
|
||||||
custom_derive! {
|
custom_derive! {
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, IterVariants(KeyPadVariants))]
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, IterVariants(KeyPadVariants))]
|
||||||
pub enum KeyPad {
|
pub enum KeyPad {
|
||||||
Asterisk,
|
Asterisk,
|
||||||
_7,
|
_7,
|
||||||
@ -357,7 +357,7 @@ impl Code for KeyPad {
|
|||||||
}
|
}
|
||||||
|
|
||||||
custom_derive! {
|
custom_derive! {
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, IterVariants(MiscVariants))]
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, IterVariants(MiscVariants))]
|
||||||
pub enum Misc {
|
pub enum Misc {
|
||||||
ZenkakuHankaku,
|
ZenkakuHankaku,
|
||||||
ND102,
|
ND102,
|
||||||
@ -849,7 +849,7 @@ impl Code for Misc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
custom_derive! {
|
custom_derive! {
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, IterVariants(FunctionVariants))]
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, IterVariants(FunctionVariants))]
|
||||||
pub enum Function {
|
pub enum Function {
|
||||||
Press,
|
Press,
|
||||||
Esc,
|
Esc,
|
||||||
@ -919,7 +919,7 @@ impl Code for Function {
|
|||||||
}
|
}
|
||||||
|
|
||||||
custom_derive! {
|
custom_derive! {
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, IterVariants(BrailleVariants))]
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, IterVariants(BrailleVariants))]
|
||||||
pub enum Braille {
|
pub enum Braille {
|
||||||
Dot1,
|
Dot1,
|
||||||
Dot2,
|
Dot2,
|
||||||
@ -967,7 +967,7 @@ impl Code for Braille {
|
|||||||
}
|
}
|
||||||
|
|
||||||
custom_derive! {
|
custom_derive! {
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, IterVariants(NumericVariants))]
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, IterVariants(NumericVariants))]
|
||||||
pub enum Numeric {
|
pub enum Numeric {
|
||||||
_0,
|
_0,
|
||||||
_1,
|
_1,
|
||||||
@ -1027,7 +1027,7 @@ impl Code for Numeric {
|
|||||||
}
|
}
|
||||||
|
|
||||||
custom_derive! {
|
custom_derive! {
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, IterVariants(TouchPadVariants))]
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, IterVariants(TouchPadVariants))]
|
||||||
pub enum TouchPad {
|
pub enum TouchPad {
|
||||||
Toggle,
|
Toggle,
|
||||||
On,
|
On,
|
||||||
@ -1061,7 +1061,7 @@ impl Code for TouchPad {
|
|||||||
}
|
}
|
||||||
|
|
||||||
custom_derive! {
|
custom_derive! {
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, IterVariants(CameraVariants))]
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, IterVariants(CameraVariants))]
|
||||||
pub enum Camera {
|
pub enum Camera {
|
||||||
ZoomIn,
|
ZoomIn,
|
||||||
ZoomOut,
|
ZoomOut,
|
||||||
@ -1103,7 +1103,7 @@ impl Code for Camera {
|
|||||||
}
|
}
|
||||||
|
|
||||||
custom_derive! {
|
custom_derive! {
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, IterVariants(AttendantVariants))]
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, IterVariants(AttendantVariants))]
|
||||||
pub enum Attendant {
|
pub enum Attendant {
|
||||||
On,
|
On,
|
||||||
Off,
|
Off,
|
||||||
@ -1137,7 +1137,7 @@ impl Code for Attendant {
|
|||||||
}
|
}
|
||||||
|
|
||||||
custom_derive! {
|
custom_derive! {
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, IterVariants(InputAssistVariants))]
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, IterVariants(InputAssistVariants))]
|
||||||
pub enum InputAssist {
|
pub enum InputAssist {
|
||||||
Prev,
|
Prev,
|
||||||
Next,
|
Next,
|
||||||
|
@ -22,7 +22,7 @@ pub trait Release: Kind + Code { }
|
|||||||
pub trait Position: Kind + Code { }
|
pub trait Position: Kind + Code { }
|
||||||
|
|
||||||
/// All supported events.
|
/// All supported events.
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
|
||||||
pub enum Event {
|
pub enum Event {
|
||||||
All,
|
All,
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ use ffi::*;
|
|||||||
use {Event};
|
use {Event};
|
||||||
use super::{Kind, Code};
|
use super::{Kind, Code};
|
||||||
|
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
|
||||||
pub enum Relative {
|
pub enum Relative {
|
||||||
Position(Position),
|
Position(Position),
|
||||||
Wheel(Wheel),
|
Wheel(Wheel),
|
||||||
@ -33,7 +33,7 @@ impl Code for Relative {
|
|||||||
}
|
}
|
||||||
|
|
||||||
custom_derive! {
|
custom_derive! {
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, IterVariants(PositionVariants))]
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, IterVariants(PositionVariants))]
|
||||||
pub enum Position {
|
pub enum Position {
|
||||||
X,
|
X,
|
||||||
Y,
|
Y,
|
||||||
@ -72,7 +72,7 @@ impl Code for Position {
|
|||||||
}
|
}
|
||||||
|
|
||||||
custom_derive! {
|
custom_derive! {
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, IterVariants(WheelVariants))]
|
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, IterVariants(WheelVariants))]
|
||||||
pub enum Wheel {
|
pub enum Wheel {
|
||||||
Horizontal,
|
Horizontal,
|
||||||
Dial,
|
Dial,
|
||||||
|
Loading…
Reference in New Issue
Block a user