Skip to content
This repository was archived by the owner on Sep 4, 2024. It is now read-only.

Question: How to get unicode char code from KeyEventArgs? #246

Open
aBothe opened this issue Sep 21, 2013 · 4 comments
Open

Question: How to get unicode char code from KeyEventArgs? #246

aBothe opened this issue Sep 21, 2013 · 4 comments
Labels
Milestone

Comments

@aBothe
Copy link

aBothe commented Sep 21, 2013

Is there a way to reproduce the actual (maybe dependent on the system's keyboard layout settings) key code (and the char instance) only from KeyEventArgs?

Imho, it's not possible directly - so KeyEventArgs should feature at least a unicode number to have the actual char representation directly available without further circumstances.

@slluis
Copy link
Member

slluis commented Sep 23, 2013

Nope, there is no api for that right now

@aBothe
Copy link
Author

aBothe commented Sep 23, 2013

I guess extending the KeyEventArgs by a simple utf16 c# char value should do it, right?
Of course, e.g. on sys key events, this value should be '\0' then or similarly invalid.

@slluis
Copy link
Member

slluis commented Sep 23, 2013

Yep

@sevoku
Copy link
Member

sevoku commented Jan 18, 2015

A new KeyEventArgs.Text property would be nice. I think all backends have function to get the Unicode for the key. But localization must be kept in mind, I think Mac uses the en-us layout for key events by default.

@sevoku sevoku added the feature label Jan 18, 2015
@sevoku sevoku added this to the v1.0 milestone Jan 31, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants