There is no simple mapping between keys and characters. Keyboard layouts can work in different ways. One example is dead keys. And once you get into IME, it gets even harder. Do not try to duplicate the keyboard layout manually in your application.
If you want which character the user entered, process WM_CHAR , not WM_KEY_DOWN/UP . It displays as a Control.KeyPress event in winforms.
source share