Replies: 1 comment 5 replies
-
I'm not sure about "splitting", but generally I like the idea of supporting commands as a way to facilitate cross-platform shortcuts. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is partly beyond the scope of Winit but deserves a little discussion.
Key
replaces the oldVirtualKeyCode
as a listing of named keys. The main difference, besidesKey
being much larger and based off a different standard is thatKey
includesCharacter(Str)
,Unidentified(NativeKey)
andDead(Option<char>)
super-categories. (Aside: shouldKey
mix named keys and super-categories in a single enum? Maybe it doesn't matter.)Fundamentally,
Key
is about naming keys. Shortcuts are similar, but not quite the same. My attempt at mapping common UI shortcuts resulted inCommand
. Besides many omissions (e.g. all media controls) this includes a few things you don't see inKey
:ViewUp
,WordLeft
,Italic
,Fullscreen
.The point is that there is a large (though not complete) overlap between these enums. Neither should ever be matched exhaustively. So should
Key
be split up to facilitate mapping "named keys" to "commands"?Examples:
Key::Alt
,Key::Fn
are modifier keys, not commandsBeta Was this translation helpful? Give feedback.
All reactions