Skip to content

Commit

Permalink
New approach: If Alt is mapped to anything, don't have it open the menu.
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Jul 17, 2024
1 parent 2ddba06 commit 9b095a9
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions Windows/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1092,29 +1092,28 @@ namespace MainWindow
// Note that if there's a screensaver password, this simple method
// doesn't work on Vista or higher.
case WM_SYSCOMMAND:
{
// Disable Alt key for menu if "Ignore Windows Key" is on (likely related)
if (g_Config.bIgnoreWindowsKey && wParam == SC_KEYMENU && (lParam >> 16) <= 0) {
// Disable Alt key for menu if it's been mapped.
if (wParam == SC_KEYMENU && (lParam >> 16) <= 0) {
if (KeyMap::IsKeyMapped(DEVICE_ID_KEYBOARD, NKCODE_ALT_LEFT) || KeyMap::IsKeyMapped(DEVICE_ID_KEYBOARD, NKCODE_ALT_RIGHT)) {
return 0;
}
if (g_keepScreenBright) {
switch (wParam) {
case SC_SCREENSAVE:
}
if (g_keepScreenBright) {
switch (wParam) {
case SC_SCREENSAVE:
return 0;
case SC_MONITORPOWER:
if (lParam == 1 || lParam == 2) {
return 0;
case SC_MONITORPOWER:
if (lParam == 1 || lParam == 2) {
return 0;
} else {
break;
}
default:
// fall down to DefWindowProc
} else {
break;
}
default:
// fall down to DefWindowProc
break;
}
return DefWindowProc(hWnd, message, wParam, lParam);
}
break;
return DefWindowProc(hWnd, message, wParam, lParam);
case WM_SETTINGCHANGE:
{
if (g_darkModeSupported && IsColorSchemeChangeMessage(lParam))
Expand Down

0 comments on commit 9b095a9

Please sign in to comment.