How to prevent the KeyDown event delay?

I'm currently trying to design a simple 3D engine that will run in a window so I'm using windows forms and not the DXUT.

I'm trying to get keyboard input working to move my camera and although the following code gets seems to do the job it has an annoying delay if you hold down the button. It moves as soon as pressed but then there is a delay before it continues moving... I don't want this delay however.

Here is the code i'm using.

this.KeyDown +=newKeyEventHandler(OnKeyPressed);

...

privatevoid OnKeyPressed(object sender,KeyEventArgs e)

{

switch(e.KeyCode)

{

caseKeys.F1:

isShowFPS = !isShowFPS;

break;

caseKeys.W:

MyCamera.position.Z +=0.2f;

break;

}

}

Crude camera moving code aside (i intend to change that later), how to i stop this delay.

I realise the DXUT framework doesn't have this problem but I don't quite understand the method it uses for keyboard input, I don't quite understand WndProc or what ever it is, and how it works. I've googled a lot for it but still haven't really found a simple solution. If anyone can explain how the DXUT framework handles keyboard input or knows of a good tutorial for teaching keyboard input I would be very greatful.

[2202 byte] By [Ceres629] at [2007-12-19]
# 1

Okay I solved it by just using DirectInput.

DirectInput wasn't as hard as I thought.

Ceres629 at 2007-9-9 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...