https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8222c0e6d8a249fd47de3…
commit 8222c0e6d8a249fd47de396306e9765b95a95268
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Sun Aug 28 20:10:06 2022 +0900
Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
CommitDate: Sun Aug 28 20:15:33 2022 +0900
[KBSWITCH][NTUSER] Revert Shift+Alt handling
The current Shift+Alt handling is buggy. The keyboard won't work frequently.
It dislikes system-side Alt (VK_MENU) key handling.
It seems like Shift+Alt handling should be in kernel.
CORE-10667
---
base/applications/kbswitch/kbswitch.c | 31 -------------------------------
win32ss/user/ntuser/hotkey.c | 4 +---
2 files changed, 1 insertion(+), 34 deletions(-)
diff --git a/base/applications/kbswitch/kbswitch.c
b/base/applications/kbswitch/kbswitch.c
index 13a1470ce2b..d1b39320561 100644
--- a/base/applications/kbswitch/kbswitch.c
+++ b/base/applications/kbswitch/kbswitch.c
@@ -16,7 +16,6 @@
PKBSWITCHSETHOOKS KbSwitchSetHooks = NULL;
PKBSWITCHDELETEHOOKS KbSwitchDeleteHooks = NULL;
UINT ShellHookMessage = 0;
-DWORD dwAltShiftHotKeyId = 0, dwShiftAltHotKeyId = 0;
HINSTANCE hInst;
HANDLE hProcessHeap;
@@ -451,25 +450,6 @@ UpdateLanguageDisplayCurrent(HWND hwnd, WPARAM wParam)
return UpdateLanguageDisplay(hwnd, hKL);
}
-VOID DoRegisterAltShiftHotKeys(HWND hwnd)
-{
- dwAltShiftHotKeyId = GlobalAddAtom(TEXT("ReactOS Alt+Shift"));
- dwShiftAltHotKeyId = GlobalAddAtom(TEXT("ReactOS Shift+Alt"));
-
- RegisterHotKey(hwnd, dwAltShiftHotKeyId, MOD_ALT | MOD_SHIFT, VK_SHIFT);
- RegisterHotKey(hwnd, dwShiftAltHotKeyId, MOD_ALT | MOD_SHIFT, VK_MENU);
-}
-
-VOID DoUnregisterAltShiftHotKeys(HWND hwnd)
-{
- UnregisterHotKey(hwnd, dwAltShiftHotKeyId);
- UnregisterHotKey(hwnd, dwShiftAltHotKeyId);
-
- GlobalDeleteAtom(dwAltShiftHotKeyId);
- GlobalDeleteAtom(dwShiftAltHotKeyId);
- dwAltShiftHotKeyId = dwShiftAltHotKeyId = 0;
-}
-
LRESULT CALLBACK
WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
@@ -489,8 +469,6 @@ WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
ActivateLayout(hwnd, ulCurrentLayoutNum);
s_uTaskbarRestart = RegisterWindowMessage(TEXT("TaskbarCreated"));
-
- DoRegisterAltShiftHotKeys(hwnd);
break;
}
@@ -499,14 +477,6 @@ WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
return UpdateLanguageDisplay(hwnd, (HKL)lParam);
}
- case WM_HOTKEY:
- {
- if (wParam != dwAltShiftHotKeyId && wParam != dwShiftAltHotKeyId)
- break;
-
- /* FALL THROUGH */
- }
-
case WM_LOAD_LAYOUT:
{
ULONG uNextNum = GetNextLayout();
@@ -599,7 +569,6 @@ WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
case WM_DESTROY:
{
- DoUnregisterAltShiftHotKeys(hwnd);
DeleteHooks();
DestroyMenu(s_hMenu);
DeleteTrayIcon(hwnd);
diff --git a/win32ss/user/ntuser/hotkey.c b/win32ss/user/ntuser/hotkey.c
index e9e11772a11..02b504fe668 100644
--- a/win32ss/user/ntuser/hotkey.c
+++ b/win32ss/user/ntuser/hotkey.c
@@ -211,9 +211,7 @@ co_UserProcessHotKeys(WORD wVk, BOOL bIsDown)
if (IsModifier)
{
/* Modifier key up -- modifier-only keys are triggered here */
- pHotKey = IsHotKey(gfsModOnlyCandidate, wVk);
- if (!pHotKey)
- pHotKey = IsHotKey(gfsModOnlyCandidate, 0);
+ pHotKey = IsHotKey(gfsModOnlyCandidate, 0);
gfsModOnlyCandidate = 0;
}
else