mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[NTUSER][KBSWITCH] Realize Alt+Shift keyboard switch (retry) (#4721)
Alt+Shift is a useful key combination to switch the current keyboard layout. CORE-11737 - Add ID_NEXTLAYOUT command to kbswitch. - Send command ID_NEXTLAYOUT to kbswitch on Alt+Shift key combination in WM_SYSKEYDOWN handling of IntDefWindowProc function. - Make IntFindWindow a non-static function.
This commit is contained in:
parent
38870875ba
commit
2469ce2c31
5 changed files with 28 additions and 1 deletions
|
@ -546,6 +546,12 @@ WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
|
|||
break;
|
||||
}
|
||||
|
||||
case ID_NEXTLAYOUT:
|
||||
{
|
||||
ActivateLayout(hwnd, GetNextLayout());
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
ActivateLayout(hwnd, LOWORD(wParam));
|
||||
|
|
|
@ -9,3 +9,4 @@
|
|||
/* Menu items */
|
||||
#define ID_EXIT 10001
|
||||
#define ID_PREFERENCES 10002
|
||||
#define ID_NEXTLAYOUT 10003
|
||||
|
|
|
@ -945,6 +945,24 @@ IntDefWindowProc(
|
|||
wParamTmp = UserGetKeyState(VK_SHIFT) & 0x8000 ? SC_PREVWINDOW : SC_NEXTWINDOW;
|
||||
co_IntSendMessage( Active, WM_SYSCOMMAND, wParamTmp, wParam );
|
||||
}
|
||||
else if (wParam == VK_SHIFT) // Alt+Shift
|
||||
{
|
||||
RTL_ATOM ClassAtom = 0;
|
||||
UNICODE_STRING ustrClass, ustrWindow;
|
||||
HWND hwndSwitch;
|
||||
|
||||
RtlInitUnicodeString(&ustrClass, L"kbswitcher");
|
||||
RtlInitUnicodeString(&ustrWindow, L"");
|
||||
|
||||
IntGetAtomFromStringOrAtom(&ustrClass, &ClassAtom);
|
||||
|
||||
hwndSwitch = IntFindWindow(UserGetDesktopWindow(), NULL, ClassAtom, &ustrWindow);
|
||||
if (hwndSwitch)
|
||||
{
|
||||
#define ID_NEXTLAYOUT 10003
|
||||
UserPostMessage(hwndSwitch, WM_COMMAND, ID_NEXTLAYOUT, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if( wParam == VK_F10 )
|
||||
{
|
||||
|
|
|
@ -3040,7 +3040,7 @@ CLEANUP:
|
|||
}
|
||||
|
||||
|
||||
static HWND FASTCALL
|
||||
HWND FASTCALL
|
||||
IntFindWindow(PWND Parent,
|
||||
PWND ChildAfter,
|
||||
RTL_ATOM ClassAtom,
|
||||
|
|
|
@ -98,6 +98,8 @@ extern PWINDOWLIST gpwlCache;
|
|||
|
||||
PWINDOWLIST FASTCALL IntBuildHwndList(PWND pwnd, DWORD dwFlags, PTHREADINFO pti);
|
||||
VOID FASTCALL IntFreeHwndList(PWINDOWLIST pwlTarget);
|
||||
HWND FASTCALL IntFindWindow(PWND Parent, PWND ChildAfter, RTL_ATOM ClassAtom,
|
||||
PUNICODE_STRING WindowName);
|
||||
|
||||
/* Undocumented dwFlags for IntBuildHwndList */
|
||||
#define IACE_LIST 0x0002
|
||||
|
|
Loading…
Reference in a new issue