Sign in to follow this  
MARS_999

Choppy keyboard input with SDL?

Recommended Posts

I am using SDL_PollEvent() and my keyinput is choppy. Meaning if you hold down the key and then press another key there is a delay before it uses the new keydown input... I am not sure what would cause this? I was using Dinput before with win32 before I moved to SDL and never had this issue before. If you were to use it as is, you would be dead in a FPS game, from the delays. Any ideas?

Share this post


Link to post
Share on other sites
I'm also using SDL_PollEvent and don't seem to have any problems with this. What's your frame rate like? Is it possible that some of your game processing might be delaying the time between SDL_PollEvent calls enough to cause it?

Share this post


Link to post
Share on other sites
Quote:
Original post by strtok
I'm also using SDL_PollEvent and don't seem to have any problems with this. What's your frame rate like? Is it possible that some of your game processing might be delaying the time between SDL_PollEvent calls enough to cause it?


It could be and I am hoping it's not for I have no idea how I would get around that...

Share this post


Link to post
Share on other sites
The only time I have had a problem with keyboard delay is when I have a low frame rate (10 or lower). Which cause a delay in the polling of the events.

Share this post


Link to post
Share on other sites
Quote:
Original post by MARS_999

It could be and I am hoping it's not for I have no idea how I would get around that...


Are you using OpenGL, and if so, do you have vsync swapping enabled? This could really delay your events if you have heavy per-frame processing going on. Do you use any kind of timers (or delta ticks) to control the frequency at which your code takes action based on events (i.e. every few frames instead of each and every frame)?

Share this post


Link to post
Share on other sites

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