Quote Originally Posted by cronodragon
Take a look at: http://msdn2.microsoft.com/en-us/library/bb174685.aspx

There is the whole list in order from 0 to 255. Just make you array in such way that it matches those ascii codes, like this:

const
AsciiKey : array[0..255] of Char =
'0', // DIK_0,
'1', // DIK_1,
'2', // DIK_2,
'3', // DIK_3,
'4', // DIK_4,
'5', // DIK_5,
'6', // DIK_6,
'7', // DIK_7,
'8', // DIK_8,
'9', // DIK_9,
'A', // DIK_A,
#0, // DIK_ABNT_C1,
#0, // DIK_ABNT_C2,
... etc

Those with value of #0 don't have ascii code. To convert your codes to Ascii just index the array with the code of which key you are getting a press.
That is unnecessary since chr(byte) already tells what each ascii number means as a letter.

You said Input.Keyboard.Keys so i assume keys are read with (un)DelphiX. Anyway this is 1 way of making key down and up events:
[pascal]// Used variables:
var
keyDown: array[0..255] of boolean;
i: integer;
chatLine: string;

...
with Input.Keyboard do
for i:=0 to 255 do
if keys[i] and (not keyDown[i]) then begin
keyDown[i]:=true; // KeyDown here

// Simple input processing (0..31 are not really characters)
if i in [32..255] then
chatLine:=chatLine+chr(i);

end else if (not keys[i]) and keyDown[i] then begin
keyDown[i]:=false; // KeyUp here

end;[/pascal]