Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

DrSmiley

Message Lag

This topic is 5553 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

Hi everyone, I''m hoping someone out there will be able to shed some light on what i''ve been tearing my hair out over for the last few days. I''m writing an opengl win32 app, and the problem occurs when holding down a single key (i.e. to move the camera forward), and moving the mouse at the same time. Upon releasing the key, the app still deems it to be depressed, for a duration based upon how much the mouse was moved. Pressing another key while still holding down the original key and moving the mouse seems to cancel this effect... When a key is pressed, all I do is set a bool in a key[] to true, and then to false as it is released through the WM_KEYDOWN and WM_KEYUP callbacks in the WndProc function. I don''t handle any callbacks from the mouse as such. Camera motion is handled at the start of a repaint where the motion is calculated based upon the mouse cursor''s location from the centre of the view, before being SetCursorPos back into the middle. Am i being a complete idiot and/or setting up my window wrong? Any ideas would be greatly appreciated.

Share this post


Link to post
Share on other sites
Advertisement
The Win32 messaging system is very slow. Try using DirectInput if you are just working with Windows.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I''m not sure if this is completely legal but you could set the keys to false yourself like...

if(keys[VK_UP])
{
//...do some stuff
keys[VK_UP]=false;
}

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!