Jump to content

Prevent beeping on invalid key presses in GUI


Recommended Posts

In an AutoIt created GUI with pretty much any control on it, if an 'invalid' key is pressed (i.e. a key that doesn't go to anything), the Windows 'Default Beep' sound is played. I'd like to prevent that sound from occurring in the GUI of one of my AutoIt apps, without globally changing any of the user's sound settings.

For example, if you run the GUICreate.au3 example script associated with the GUICreate() help topic and then begin typing the alphabet, it beeps on each keypress (unless you've disabled the Default Beep sound in your Windows settings). Is there an easy way to have it just ignore invalid or meaningless keypresses rather than screaming in pain about them?

Interestingly enough, if you comment out the part of the GUICreate.au3 script that creates the button control, so that you have just a bare GUI window with no controls on it, then there are no beeps triggered by errant keypresses. But then adding just about any other control to the GUI where A B C aren't valid keypresses will bring back the beeps.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...