Jump to content
  • Advertisement

Archived

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

+AA_970+

keyup in direct input

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

In direct input how would i detect if a key is up? i hope it''s similar to my keydown macro #define KEYDOWN(key)(didod[ i ].dwOfs == key && didod.dwData & 0x80) +AA_970+

Share this post


Link to post
Share on other sites
Advertisement
yea that''s what i thought, i guess that''s not the problem then. I''ll explain, when a key is press, such as the up key to move the player up, it works, but if another key it pressed at the same time the player stops moving up as if it dosen''t recognize the key is being pressed.

Anyone know how to stop this?

Also, i''m using buffered input will using immediate input get rid of this problem?

+AA_970+

Share this post


Link to post
Share on other sites
Immediate should help, it gives you a 256 byte array with the state of each key at the time of the call. To detect Key Ups, I keep a copy of that array (which would be the last frame) and compare it to the current array. This is not real clean, but it works. I threw it together to get my input code up and running quick.

Share this post


Link to post
Share on other sites
(Shrugs)...
I just track WM_KEYUP and WM_SYSKEYUP messages on my main window. Any particular reason I should use directinput instead?

Share this post


Link to post
Share on other sites
I have heard it''s faster than message dealing every frame, oh and you can use Force Feedback... Yipee!


-Mezz

Share this post


Link to post
Share on other sites
Some keyboards just won''t send data for certain combinations of keys being pressed together, sadly.

Share this post


Link to post
Share on other sites
Are you keeping a log of the input events you are receiving from the buffered data? This could help you determine whether the problem was in DirectInput or your game logic. In buffered input you have to rely on the sequence of events to keep you in the accurate state.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!