Implement `Hash` on some enums in `backend::input`

This commit is contained in:
i509VCB 2021-10-17 02:19:39 -05:00
parent c8d56f1cf3
commit 953d9ce158
2 changed files with 5 additions and 4 deletions

View File

@ -28,6 +28,7 @@
#### Backends #### Backends
- `x11rb` event source integration used in anvil's XWayland implementation is now part of smithay at `utils::x11rb`. Enabled through the `x11rb_event_source` feature. - `x11rb` event source integration used in anvil's XWayland implementation is now part of smithay at `utils::x11rb`. Enabled through the `x11rb_event_source` feature.
- `KeyState`, `MouseButton`, `ButtonState` and `Axis` in `backend::input` now derive `Hash`.
- New `DrmNode` type in drm backend. This is primarily for use a backend which needs to run as client inside another session. - New `DrmNode` type in drm backend. This is primarily for use a backend which needs to run as client inside another session.
### Bugfixes ### Bugfixes

View File

@ -77,7 +77,7 @@ impl<B: InputBackend> Event<B> for UnusedEvent {
} }
/// State of key on a keyboard. Either pressed or released /// State of key on a keyboard. Either pressed or released
#[derive(Debug, PartialEq, Eq, Clone, Copy)] #[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)]
pub enum KeyState { pub enum KeyState {
/// Key is released /// Key is released
Released, Released,
@ -110,7 +110,7 @@ impl<B: InputBackend> KeyboardKeyEvent<B> for UnusedEvent {
} }
/// A particular mouse button /// A particular mouse button
#[derive(Debug, PartialEq, Eq, Clone, Copy)] #[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)]
pub enum MouseButton { pub enum MouseButton {
/// Left mouse button /// Left mouse button
Left, Left,
@ -123,7 +123,7 @@ pub enum MouseButton {
} }
/// State of a button on a pointer device, like mouse or tablet tool. Either pressed or released /// State of a button on a pointer device, like mouse or tablet tool. Either pressed or released
#[derive(Debug, PartialEq, Eq, Clone, Copy)] #[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)]
pub enum ButtonState { pub enum ButtonState {
/// Button is released /// Button is released
Released, Released,
@ -150,7 +150,7 @@ impl<B: InputBackend> PointerButtonEvent<B> for UnusedEvent {
} }
/// Axis when scrolling /// Axis when scrolling
#[derive(Debug, PartialEq, Eq, Clone, Copy)] #[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)]
pub enum Axis { pub enum Axis {
/// Vertical axis /// Vertical axis
Vertical, Vertical,