Sign in to follow this  

Keyboard input delay

This topic is 2661 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Setting up a win32 window and message handling function like such

LRESULT CALLBACK WndProc(etc....)
{
switch(message)
{
case WM_KEYDOWN:
{
switch(wParam)
{
case 0x57:
///Do something if 'W' key is hit
}
}
}
}

Doing this, causes a short delay if you hold down the 'W' key. My specific problem, is this. Im just learning D3D, and I want to move the camera sort of like a fps. So if the user holds down 'W', the camera move's forward, or if they push and hold 'S', they move back. Easy enough to accomplish by assigning a global variable to the D3DXMatrixLookAtLH.

So the problem is, If I push and hold down 'W', the camera will move forward, stop, then continue to move forward smoothly after the initial delay.(Im incrementing the variable in my wParam switch).

How would you fix this? Thanks.

Share this post


Link to post
Share on other sites

This topic is 2661 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this