Skip to content
Discussion options

You must be logged in to vote

Hello! Thanks for asking!

As far as I understand, KeyChar of the KeyTyped event doesn't really suit you, because you don't want a character that's typed by the key press. Rather, you want the actual name of the key (i.e. what the key looks like on a physical keyboard). Unfortunately, there's no "official" way to get such a string representation of a key.

This is a problem which seems simple but may include some subtle edge cases. For example, the same key can have different names on different OSes: Alt on Windows is Option on macOS; Win key on Windows is Command on macOS, Super on some Linux distributions, and Meta on others; and for some absolutely inexplicable reason Microsoft recently …

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@DaltonSW
Comment options

@TolikPylypchuk
Comment options

@DaltonSW
Comment options

@TolikPylypchuk
Comment options

Answer selected by TolikPylypchuk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants