Quote Originally Posted by NecroDOME
it's working, but not really as I expected... now it's only grabs 'ABC' and not 'abc' (upper case only). I need it for some text input. WM_CHAR doesn't return the arrow keys and WM_KEYDOWN doesn't return the lower case chars. And it makes % and & from arrow chars.
Test for VK_SHIFT being down as well, then case as appropriate. Of course, you can also split your code into two areas, one in the standard windows handler, and the other in the standard OnKeyDown. The following code may help you out as well:

[pascal]// IsKeyDown
//
function IsKeyDown(c : Char) : Boolean;
var
vk : Integer;
begin
// '$FF' filters out translators like Shift, Ctrl, Alt
vk:=VkKeyScan(c) and $FF;
if vk<>$FF then
Result:=(GetAsyncKeyState(vk)<0>0);
if Result then vLastWheelDelta:=0;
end;
VK_MOUSEWHEELDOWN : begin
Result:=(vLastWheelDelta<0);
if Result then vLastWheelDelta:=0;
end;
else
Result:=(GetAsyncKeyState(vk)<0);
end;
end;[/pascal]

This is taken from GLScene, but its not dependent upon GLScene.