Skip to main content
gamedev.net
🔒 Locked

Input woes

Started by Nitrogenycs Aug 15, 2006 at 1:59 PM 1 replies 850+ views
Original Post
Nitrogenycs
Nitrogenycs
Hello, I experienced some problems with input. So far I tried the GetAsyncKey method and the WM_KEYDOWN/WM_CHAR one. Both methods seem to have the flaw that if you press a key, a message will be fired, then like 0.3 seconds nothing and after that the usual repeating messages of the keypress come in. Is there a better way then the suggestions here: http://www.gamedev.net/community/forums/topic.asp?topic_id=297944 . The GetAsyncKey() approach does not work for me, the WM_KEYDOWN approach is not suited because with that the finest granularity is 250ms which is way too long. I'd love to avoid DirectInput if possible, but if it does the job and is not such a bitch to use like the other methods, I'd go with that. What's your advise?
Evil Steve
Evil Steve
Quote:
Original post by Nitrogenycs
I experienced some problems with input. So far I tried the GetAsyncKey method and the WM_KEYDOWN/WM_CHAR one. Both methods seem to have the flaw that if you press a key, a message will be fired, then like 0.3 seconds nothing and after that the usual repeating messages of the keypress come in.
The delay depends on the keyboard settings of a uses PC. WM_CHAR is designed to be used for text input, for text boxes for instance. If you want to have WM_KEYDOWN messages fired every loop, just make a simple input wrapper class that marks a key as down when you get the WM_KEYDOWN message, and marks it as up when you get the WM_KEYUP message. Then you can poll your class every frame to see what keys are in what state.

Topic Locked

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

Sign in to reply to this topic.