Jump to content
  • Advertisement
Sign in to follow this  
Bulhakov

How to get rid of the windows default "ding" on key press?

This topic is 4100 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 wrote an MFC applet in C++ in VS 7.0 that so far was all mouse operated. But now I started adding keyboard support (for moving around in an OpenGL window) and encountered a problem: Whenever I press a key (other than the arrow keys and some other "neutral" keys) I keep hearing the annoying windows default "ding.wav"! I can of course turn it off in the control panel, but I that does not really fix the problem. I'm using GetKeyState on they keys that interest me (AWSD and arrow keys). I'm guessing it's a problem with the focus staying on one of my widgets which sounds the alert when an unsopported keypress is encountered. Any ideas how to fix this?

Share this post


Link to post
Share on other sites
Advertisement
I don't know anything about this API, but did you try setting the focus onto a widget that supports those keypresses? (Does the window itself count as a widget?)

Share this post


Link to post
Share on other sites
Well that's the problem. I don't know how to set the focus to my GL window (it's in a Picture Control).

Just clicking on it does not seem to do it (or maybe it does, but the keystrokes still cause the windows alert).

Share this post


Link to post
Share on other sites
I can disable/remove the ding, but that will not fix this problem on other PCs.

I managed to set the focus to my GL control through:
GetDlgItem(IDC_OPENGL)->SetFocus;
but it still raises the alert when most keys are pressed. (I feel stupid for not reading about the SetFocus earlier. It's just something I never needed before.)

It's sort of annoying to run around a virtual environment and keep hearing a constant "dingdingdingding" (But only when I use the AWSD. The arrow keys don't cause this problem.)

Maybe I can use something to the likes of the KeyPreview property (but it only works for windows forms)
http://msdn2.microsoft.com/en-us/library/system.windows.forms.form.keypreview.aspx

Any further help/advice much appreciated

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!