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
- `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.
### Bugfixes

View File

@ -77,7 +77,7 @@ impl<B: InputBackend> Event<B> for UnusedEvent {
}
/// 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 {
/// Key is released
Released,
@ -110,7 +110,7 @@ impl<B: InputBackend> KeyboardKeyEvent<B> for UnusedEvent {
}
/// A particular mouse button
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
#[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)]
pub enum MouseButton {
/// Left mouse button
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
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
#[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)]
pub enum ButtonState {
/// Button is released
Released,
@ -150,7 +150,7 @@ impl<B: InputBackend> PointerButtonEvent<B> for UnusedEvent {
}
/// Axis when scrolling
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
#[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)]
pub enum Axis {
/// Vertical axis
Vertical,