I am trying to map a virtual keycode to a char.
My code uses ProcessCmdKey to listen to WM_KEYDOWN which gives me access to the key pressed. For example, when I press single quote I get a key of 222 which I want to have it mapped to keychar 39 which represents... you guessed it... single quote.
My dev context is: - .net Framework 2.0 - UserControl placed in a lot of places
Do you know the answer to the question?
Isn't that what the System.Windows.Form.KeysConverter class is for?
KeysConverter kc = new KeysConverter(); string keyChar = kc.ConvertToString(keyData);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With