mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-11 21:31:29 +11:00
Add ordering traits to VirtualKeyCode (#713)
Motivation: This allows VirtualKeyCode variants to be stored in a BTreeSet. Unlike HashSets, BTreeSets implement Ord and Hash, allowing them to be keys in a {Hash|BTree}Maps. This is nice, e.g. when implementing keyboard shortcuts functionality, which maps a set of pressed keys to some action.
This commit is contained in:
parent
5be52c9753
commit
b049a4dc66
|
@ -6,6 +6,7 @@
|
||||||
- On Windows, fix issue where resizing or moving window combined with grabbing the cursor would freeze program.
|
- On Windows, fix issue where resizing or moving window combined with grabbing the cursor would freeze program.
|
||||||
- On Windows, fix issue where resizing or moving window would eat `Awakened` events.
|
- On Windows, fix issue where resizing or moving window would eat `Awakened` events.
|
||||||
- On X11, fixed a segfault when using virtual monitors with XRandR.
|
- On X11, fixed a segfault when using virtual monitors with XRandR.
|
||||||
|
- Derive `Ord` and `PartialOrd` for `VirtualKeyCode` enum.
|
||||||
|
|
||||||
# Version 0.18.0 (2018-11-07)
|
# Version 0.18.0 (2018-11-07)
|
||||||
|
|
||||||
|
|
|
@ -253,7 +253,7 @@ pub enum MouseScrollDelta {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Symbolic name for a keyboard key.
|
/// Symbolic name for a keyboard key.
|
||||||
#[derive(Debug, Hash, PartialEq, Eq, Clone, Copy)]
|
#[derive(Debug, Hash, Ord, PartialOrd, PartialEq, Eq, Clone, Copy)]
|
||||||
#[repr(u32)]
|
#[repr(u32)]
|
||||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||||
pub enum VirtualKeyCode {
|
pub enum VirtualKeyCode {
|
||||||
|
|
Loading…
Reference in a new issue