wdl-ol icon indicating copy to clipboard operation
wdl-ol copied to clipboard

Keyboard input causing "Alert" noise/beep in Windows

Open scottmudge opened this issue 6 years ago • 6 comments

So I've created an OpenGL interface control as a child of the IControl class, which uses GLFW to create a context, and then an immediate-mode GUI backend to create user interface elements.

Because I am unable to create a new window handle and latch the input function callbacks to that as GLFW typically does, I'm simply overriding the in-built input virtual functions (OnMouseDown, OnMouseUp, OnKeyDown, etc), and then passing that data to my OpenGL GUI.

I'm able to successfully pass the mouse input to the UI, but I am having problems passing the keyboard input.

I can capture the key data fine using OnKeyDown (though I cannot get Ctrl/Alt/Shift, etc), but every time I hit a key, Windows creates the "Alert" beep/noise, and I can't stop it.

How can I appropriately capture keyboard input without having Windows throw a fit?

scottmudge avatar Jun 29 '18 16:06 scottmudge

is this in a standalone app or plugin?

olilarkin avatar Jun 29 '18 17:06 olilarkin

Standalone app, the plugin variants work fine.

I think the problem lies in the fact that there is no edit control for the input to be focused into. All that exists is the child plugin window. I think creating an invisible editable control to the parent window would fix the problem.

Ideally I would like to get rid of the menu bar and parent window entirely, since the about window and settings will be taken care of by the secondary UI. I would just show the plugin window as a WS_OVERLAPPED style window, but that seems like a lot of modification to make. Especially since I would still like to use the accessory functions, like being able to request files, etc.

scottmudge avatar Jun 29 '18 17:06 scottmudge

i would try putting a breakpoint here https://github.com/olilarkin/wdl-ol/blob/master/IPlugExamples/IPlugEffect/app_wrapper/app_dialog.cpp#L564

perhaps these keys need to be caught and forwarded

olilarkin avatar Jun 29 '18 22:06 olilarkin

Hi Oli,

Well if I change the plugin window from WS_CHILD to WS_OVERLAPPED, the beeping/alert noise stops. Of course, doing so causes the child plugin window to be a new, detached window, which is undesirable.

I think what I'll end up doing is catching all the input in the main dialog wrapper in the file you mentioed to prevent the alert tone, and then use the gainput library to act as a cross-platform input interface. This will also allow me to interface better with touch-screens, providing better future portability to android and ios.

scottmudge avatar Jun 30 '18 13:06 scottmudge

interested to see what you do with GLFW...

olilarkin avatar Jun 30 '18 22:06 olilarkin

Hey I sent you an email about iPlug2. My private email server is often flagged as spam (I think spammers use my host's shared smtp server?), just thought I'd let you know just in case.

scottmudge avatar Jul 01 '18 13:07 scottmudge