Skip to main content
GameDev.net gamedev.net
🔒 Locked

Key repeat?

Started by YodaTheCoder Oct 13, 2001 at 2:18 AM 3 replies 450+ views
Original Post
YodaTheCoder
YodaTheCoder
Curious as to how I may end this bloody (that''s with some British emphasism) key thing.. You know when you push a character, it inputs it, waits a little, then starts an input loop? Well, I''ve been trying to get rid of that while I use the ''a'' and ''d'' key''s to move my figure around the screen. Any functions? ~Jesse "Sleep is to me as honest is to lawyer."
Oluseyi
Oluseyi
That''s what DirectInput is for, largely. You can also look into the WM_KEYDOWN window message.
Bad Monkey
Bad Monkey
another way to do it (again without DirectInput) is to use the GetAsyncKeyState(...) function.

This will tell you whether a key is down or up at the moment you call it... so just stick this call in your game loop, or in a timer function, or wherever you feel like checking your keys... i don''t care
playmesumch00ns
playmesumch00ns
Just use DirectInput. The SDK''s help files tell you everything you need to know, and once you''ve got round the pain of setting up objects etc it''s very easy to use =]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.