Jump to content
  • Advertisement
Sign in to follow this  
silverphyre673

I'm sorry - I know I just saw this here the other day. Multiple inputs from keyboard

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

Sorry again, I can vaguely remember this from the other day, but it wasn't a problem then and I can't find the other thread. I'm finishing up pong, just for kicks, but I need both player one and two to be able to send keypresses at the same time. Do I have to multithread the application to do this? I don't want to make pong multithreaded. Is there some other way to get multiple keypresses at once? Thanks a bunch.

Share this post


Link to post
Share on other sites
Advertisement
What is the input system of your program? Console mode, Win32 event queue, SDL, DirectInput, etc.

Share this post


Link to post
Share on other sites
win32 event queue, sorry. Also, is there any way to automatically set the program so that it doesn't do the whole "get one keypress, delay, then do lots of keypresses while the button is held down" thing? I just want it to treat the keys like they are being held down the entire time, so the movement is smoother, you know? Thanks.

Share this post


Link to post
Share on other sites
Simplest method is probably to stop using the event queue, and use another Win32 function which tells you whether a particular key is currently pressed or not; just check for all input keys each frame. The list of keyboard-input-related Win32 functions is here.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!