mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-19 18:11:39 -05:00
Fix cursor being hidden when pressing modifier keys (#19473)
Closes #19445
This commit is contained in:
committed by
GitHub
parent
b8f35a31c2
commit
b357de9897
@@ -194,6 +194,22 @@ static wil::unique_mutex acquireMutexOrAttemptHandoff(const wchar_t* className,
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static constexpr bool IsInputKey(WORD vkey) noexcept
|
||||||
|
{
|
||||||
|
return vkey != VK_CONTROL &&
|
||||||
|
vkey != VK_LCONTROL &&
|
||||||
|
vkey != VK_RCONTROL &&
|
||||||
|
vkey != VK_MENU &&
|
||||||
|
vkey != VK_LMENU &&
|
||||||
|
vkey != VK_RMENU &&
|
||||||
|
vkey != VK_SHIFT &&
|
||||||
|
vkey != VK_LSHIFT &&
|
||||||
|
vkey != VK_RSHIFT &&
|
||||||
|
vkey != VK_LWIN &&
|
||||||
|
vkey != VK_RWIN &&
|
||||||
|
vkey != VK_SNAPSHOT;
|
||||||
|
}
|
||||||
|
|
||||||
HWND WindowEmperor::GetMainWindow() const noexcept
|
HWND WindowEmperor::GetMainWindow() const noexcept
|
||||||
{
|
{
|
||||||
_assertIsMainThread();
|
_assertIsMainThread();
|
||||||
@@ -486,7 +502,13 @@ void WindowEmperor::HandleCommandlineArgs(int nCmdShow)
|
|||||||
|
|
||||||
if (msg.message == WM_KEYDOWN)
|
if (msg.message == WM_KEYDOWN)
|
||||||
{
|
{
|
||||||
IslandWindow::HideCursor();
|
const auto vkey = static_cast<WORD>(msg.wParam);
|
||||||
|
|
||||||
|
// Hide the cursor only when the key pressed is an input key (ignore modifier keys).
|
||||||
|
if (IsInputKey(vkey))
|
||||||
|
{
|
||||||
|
IslandWindow::HideCursor();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user