We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 865

Summary: Windows "default beep" when any Alt+Key is used
Product: SDL Reporter: Alistair John Strachan <alistair>
Component: eventsAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: amaranth72, ensiform, eruditionalsoul
Version: 2.0.3   
Hardware: x86_64   
OS: Windows 8   
Attachments: Modified SDL_windowsevents.c

Description Alistair John Strachan 2009-10-25 16:39:02 UTC
When pressing Alt+<Key> with DIB or directx, Windows will generate a "default beep" (as though the application can't handle the event), even though the event is processed by the application correctly.

Confirmed as happening on Windows XP and Windows 7; an SDL 1.2.13 built with the same toolchain doesn't have this problem.
Comment 1 Sam Lantinga 2009-11-16 21:00:50 UTC
This is fixed in subversion with revision 5262.
You can get the fix here:
http://www.libsdl.org/tmp/SDL-1.2.zip
Comment 2 Alistair John Strachan 2009-11-21 07:44:15 UTC
(In reply to comment #1)
> This is fixed in subversion with revision 5262.
> You can get the fix here:
> http://www.libsdl.org/tmp/SDL-1.2.zip

Cheers Sam, confirmed.
Comment 3 Sam Lantinga 2009-11-21 15:45:51 UTC
Great, thanks!
Comment 4 Andrew L 2014-10-09 12:57:15 UTC
This is now happening on windows 8.1 with SDL 2.0.3. I added this code to the SDL_windowsevent.c in the WIN_WindowProc function:

case WM_MENUCHAR:
{
return MNC_CLOSE << 16;
}
break;

Which resolved the issue.
Comment 5 Andrew L 2014-10-09 13:03:42 UTC
Created attachment 1892 [details]
Modified SDL_windowsevents.c

Here is the file I modified.
Comment 6 Alex Szpakowski 2014-10-10 06:55:23 UTC
https://bugzilla.libsdl.org/show_bug.cgi?id=2669
Comment 7 ensiform 2015-01-24 03:21:39 UTC
The correct fix for this is to handle the WM_SYSCOMMAND SC_KEYMENU and return similar to how SDL2 currently eats SC_SCREENSAVE / SC_MONITORPOWER

Located https://hg.libsdl.org/SDL/file/8d826bc39a45/src/video/windows/SDL_windowsevents.c#l795

compare wParam & 0xFFF0 and if it is equal to SC_KEYMENU, return 0 (or optionally add a flag like the screensaver though default to true maybe?

This bug is same as #2669, reporting there as well.
Comment 8 Ryan C. Gordon 2015-02-19 06:32:14 UTC
Marking a large number of bugs with the "triage-2.0.4" keyword at once. Sorry
if you got a lot of email from this. This is to help me sort through some bugs
in regards to a 2.0.4 release. We may or may not fix this bug for 2.0.4,
though!
Comment 9 Ryan C. Gordon 2015-02-19 21:01:09 UTC
Going to close this one as FIXED as it dealt with SDL 1.2; we'll deal with 2.0 in Bug #2669.

--ryan.