It would help if you would share with us the code you are using for the translation but...
I am pretty certain that the KeyCodes and ASCII codes don't completely correspond. For that matter, KeyCodes aren't even always numbers.
- private void Form1_KeyDown(object sender, KeyEventArgs e)
-
{
-
string bob = e.KeyCode.ToString();// Put a breakpoint here
-
}
For example, testing with "KeyDown" event and pressing an unmodified 'a' gets you a KeyCode of 65. But 65 is an ASCII uppercase A.
With a KeyValue of 65.
Pressing a period gets you a KeyCode of "RButton | MButton | Back | ShiftKey | Space | F17"
With a KeyValue of 190
When you say you are entering a KeyCode manually like 65.... Are you saying you are typing in a number into a text box and you are translating that number, and expecting a single character to be returned? So if you type 65 you want an upper case A. If you enter 46 you want a period.
But later you say you want a period returned when you press a period. "." ASCII 46. I don't know why you are translating it at all. If you want returned, exactly what is pressed then just use it as you receive it.
Obviously there are two different ways you are taking in values and trying to convert them. In one you want to convert a number like 65 to a character, and in another you want to take a character like a period and simply return a period.
Without seeing the code for what you're doing I don't think there's much more advice I can offer.