*** src/w32fns.c.orig Tue Feb 26 01:15:07 2002 --- src/w32fns.c Tue Feb 26 01:21:59 2002 *************** *** 4197,4206 **** --- 4197,4245 ---- record_keydown (wParam, lParam); wParam = map_keypad_keys (wParam, (lParam & 0x1000000L) != 0); windows_translate = 0; + /* An evil (and probably stupid) workaround for using menus + * with the keyboard: catch Alt+[A-Z] (and Alt-SPACE for the + * system menu) events and pass them to TranslateMessage(). + * + * Other combinations like Alt+1 or Alt+F4 (!) will still go + * to Emacs and can be used normallly. + * + * TranslateMessage sends a WM_SYSCHAR event, which we + * must not catch. So, I've disabled the WM_SYSCHAR case. + * Maybe it screws up something - dunno. :-) + * + * You might also want to edit menu-bar.sl like this: + * + * Change + * (cons "File" menu-bar-files-menu) + * to... + * (cons "&File" menu-bar-files-menu) + * + * WARNING: this patch may make your Emacs crash! The + * Spy program that ships with MSVC 6.0 shows an + * ever-increasing nesting level for window messages. + * Seems like a Bad Thing, but I haven't tested it yet. :) + * + * [26 Feb 2002, address@hidden + */ + + /* ALT key is down, and the pushed key is space or something + * between A and Z: */ + if(((unsigned long) lParam & (((unsigned long) 1) << 29)) && ( + wParam==VK_SPACE || + ((long) 'A' <= wParam && wParam <= (long) 'Z') + )) + { + MSG windows_msg = { hwnd, msg, wParam, lParam, 0, {0,0} }; + windows_msg.time = GetMessageTime (); + TranslateMessage(&windows_msg); + return 0; + } + switch (wParam) { case VK_LWIN: if (NILP (Vw32_pass_lwindow_to_system)) { *************** *** 4382,4392 **** goto dflt; } /* Fall through */ ! case WM_SYSCHAR: case WM_CHAR: post_character_message (hwnd, msg, wParam, lParam, w32_get_key_modifiers (wParam, lParam)); break; --- 4421,4431 ---- goto dflt; } /* Fall through */ ! /* case WM_SYSCHAR: */ case WM_CHAR: post_character_message (hwnd, msg, wParam, lParam, w32_get_key_modifiers (wParam, lParam)); break;