mirror of
https://github.com/reactos/reactos.git
synced 2025-04-05 21:21:33 +00:00
[USER32] App Switcher Arrow keys (#1136)
Implement Arrow keys on App Switcher (Alt+Tab). CORE-15449
This commit is contained in:
parent
235042a16c
commit
00dd17e6e5
1 changed files with 62 additions and 5 deletions
|
@ -480,6 +480,50 @@ void RotateTasks(BOOL bShift)
|
|||
}
|
||||
}
|
||||
|
||||
static void MoveLeft(void)
|
||||
{
|
||||
selectedWindow = selectedWindow - 1;
|
||||
if (selectedWindow < 0)
|
||||
selectedWindow = windowCount - 1;
|
||||
InvalidateRect(switchdialog, NULL, TRUE);
|
||||
}
|
||||
|
||||
static void MoveRight(void)
|
||||
{
|
||||
selectedWindow = (selectedWindow + 1) % windowCount;
|
||||
InvalidateRect(switchdialog, NULL, TRUE);
|
||||
}
|
||||
|
||||
static void MoveUp(void)
|
||||
{
|
||||
INT iRow = selectedWindow / nCols;
|
||||
INT iCol = selectedWindow % nCols;
|
||||
|
||||
--iRow;
|
||||
if (iRow < 0)
|
||||
iRow = nRows - 1;
|
||||
|
||||
selectedWindow = iRow * nCols + iCol;
|
||||
if (selectedWindow >= windowCount)
|
||||
selectedWindow = windowCount - 1;
|
||||
InvalidateRect(switchdialog, NULL, TRUE);
|
||||
}
|
||||
|
||||
static void MoveDown(void)
|
||||
{
|
||||
INT iRow = selectedWindow / nCols;
|
||||
INT iCol = selectedWindow % nCols;
|
||||
|
||||
++iRow;
|
||||
if (iRow >= nRows)
|
||||
iRow = 0;
|
||||
|
||||
selectedWindow = iRow * nCols + iCol;
|
||||
if (selectedWindow >= windowCount)
|
||||
selectedWindow = windowCount - 1;
|
||||
InvalidateRect(switchdialog, NULL, TRUE);
|
||||
}
|
||||
|
||||
VOID
|
||||
DestroyAppWindows(VOID)
|
||||
{
|
||||
|
@ -595,21 +639,34 @@ LRESULT WINAPI DoAppSwitch( WPARAM wParam, LPARAM lParam )
|
|||
if (Esc) break;
|
||||
if (GetKeyState(VK_SHIFT) < 0)
|
||||
{
|
||||
selectedWindow = selectedWindow - 1;
|
||||
if (selectedWindow < 0)
|
||||
selectedWindow = windowCount - 1;
|
||||
MoveLeft();
|
||||
}
|
||||
else
|
||||
{
|
||||
selectedWindow = (selectedWindow + 1)%windowCount;
|
||||
MoveRight();
|
||||
}
|
||||
InvalidateRect(switchdialog, NULL, TRUE);
|
||||
}
|
||||
else if ( msg.wParam == VK_ESCAPE )
|
||||
{
|
||||
if (!Esc) break;
|
||||
RotateTasks(GetKeyState(VK_SHIFT) < 0);
|
||||
}
|
||||
else if ( msg.wParam == VK_LEFT )
|
||||
{
|
||||
MoveLeft();
|
||||
}
|
||||
else if ( msg.wParam == VK_RIGHT )
|
||||
{
|
||||
MoveRight();
|
||||
}
|
||||
else if ( msg.wParam == VK_UP )
|
||||
{
|
||||
MoveUp();
|
||||
}
|
||||
else if ( msg.wParam == VK_DOWN )
|
||||
{
|
||||
MoveDown();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue