Here’s the simplest code that reproduces the issue on my machine:
import wx app = wx.App(False) frame = wx.Frame(None, title="BEEP") text = wx.Panel(frame) frame.SetFocus() frame.Show() app.MainLoop()
After clicking on the window, anywhere, any key on my keyboard causes the macOS “bell” sound to ring; the same one which plays when something is out of focus. The desired output is for there to be no sound.
In an application with several panels where some need to take in user input and others do not, I am left with an application that constantly beeps when users press keys. Keys are meant be pressed and picked up by the top-level frame by wx.EVT_CHAR_HOOK, and furthermore custom audio is meant to be played along with these key presses, but the macOS bell sound is ruining the entire situation. The keys are registered, but they consistently cause beeps.
Can this issue be resolved programmatically? How is this issue not present in almost every WX application(Pretty much every demo I’ve copied-pasted has had this same issue)? Surely I must be missing something obvious…