Jump to content
  • Advertisement
Sign in to follow this  
Syranide

Direct Input, meep meep!

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

I know someone is gonna kill me for asking this, but seriously, everything is just working out great... except that I just noticed that the damn windows keeps giving me those damn beeps every time I hit a key in my game. DI works great, I thought I wouldn't post any code as I figure someone who knows how to fix it would already know about it, I create the device using DISCL_FOREGROUND | DISCL_NONEXCLUSIVE and except for that there isn't exactly any magic going on there. Does anyone know how to get rid of those beeps? Woho, my traffic simulation engine works perfectly now!

Share this post


Link to post
Share on other sites
Advertisement
Weird. As far as I know, the beeping has nothing to do with DirectInput. Are you sure this isn't an issue specific to your test configuration?

As a very-wild-guess, do you use any textboxes in your app/window? And do you handle WM_CHAR messages at all?

Share this post


Link to post
Share on other sites
Quote:
Original post by Coder
Weird. As far as I know, the beeping has nothing to do with DirectInput. Are you sure this isn't an issue specific to your test configuration?

As a very-wild-guess, do you use any textboxes in your app/window? And do you handle WM_CHAR messages at all?


Sorry for the late response, I was away all day.

I've done this before and I've never had any problems like this, searched a lot on the internet but couldn't find anything on it/or setting up DirectInput appropriatly with a window that helped me (however I guessed that DirectInput would perhaps prevent this behaviour).

I already tried handling the WM_CHAR (WM_KEYDOWN too) and returning so, but no difference.

...

Oh my god ... who could have thought:
An old faulty SetFocus(hWnd) did it, when it was supposed to be SetFocus(m_hWnd) (hWnd is just a nullpointer), which in term likely meant set no focus, which in term meant that windows complained because no container had focus when I was pressing the key (or didn't allow input).

Look at that :S

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I also have a strange problem with my program, everything with direct input works fine, but DIK_DOWN, DIK_UP, DIK_RIGHT, and DIK_LEFT. All other keys work, except these, does this have anything to do with it running on my laptop

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Sorry, just ignore my post, i figured it out, i was sending in a char and DIK_DOWN was more than a char so it trunicated the value and didn't read for the right key, or any key for that matter sry

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.

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!