Revise Key and KeyCode enums
Split `Key` into clear categories, like `Named`, `Dead`, Character`, `Unidentified` removing the `#[non_exhaustive]` from the `Key` itself. Similar action was done for the `KeyCode`. Fixes: #2995 Co-authored-by: Kirill Chibisov <contact@kchibisov.com>
This commit is contained in:
parent
b9e1e96eaa
commit
acfeff5327
31 changed files with 1456 additions and 1277 deletions
|
|
@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
|
|||
use winit::{
|
||||
dpi::{LogicalPosition, LogicalSize, PhysicalPosition, PhysicalSize},
|
||||
event::{ElementState, MouseButton, MouseScrollDelta, TouchPhase},
|
||||
keyboard::{Key, KeyCode, KeyLocation, ModifiersState},
|
||||
keyboard::{Key, KeyCode, KeyLocation, ModifiersState, NamedKey, PhysicalKey},
|
||||
window::CursorIcon,
|
||||
};
|
||||
|
||||
|
|
@ -23,7 +23,9 @@ fn events_serde() {
|
|||
needs_serde::<MouseButton>();
|
||||
needs_serde::<MouseScrollDelta>();
|
||||
needs_serde::<Key>();
|
||||
needs_serde::<NamedKey>();
|
||||
needs_serde::<KeyCode>();
|
||||
needs_serde::<PhysicalKey>();
|
||||
needs_serde::<KeyLocation>();
|
||||
needs_serde::<ModifiersState>();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue