- /* This stops ALT press-release doing a 'COMMAND MENU' function */
- if (!cfg.alt_only) {
- if (message == WM_SYSKEYUP && wParam == VK_MENU)
+ /* ALT alone may or may not want to bring up the System menu */
+ if (wParam == VK_MENU) {
+ if (cfg.alt_only) {
+ static int alt_state = 0;
+ if (message == WM_SYSKEYDOWN)
+ alt_state = 1;
+ else if (message == WM_SYSKEYUP && alt_state)
+ PostMessage(hwnd, WM_CHAR, ' ', 0);
+ if (message == WM_SYSKEYUP)
+ alt_state = 0;
+ } else