Skip to content

Commit

Permalink
fix(conhost): don't pass F8 to underlying game code
Browse files Browse the repository at this point in the history
Since we want to use F8 as a 'secure attention' key later on, this should not be captured by any game/user code.
  • Loading branch information
blattersturm committed Dec 18, 2021
1 parent 7868b7a commit 03eae57
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions code/components/conhost-v2/src/ConsoleHost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,16 @@ static InitFunction initFunction([] ()

InputHook::DeprecatedOnWndProc.Connect([](HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, bool& pass, LRESULT& lresult)
{
// prevent the game from knowing we pressed F8
if (msg == WM_KEYDOWN || msg == WM_KEYUP)
{
if (wParam == VK_F8)
{
pass = false;
}
}

// save the last console flag
hadConsoleFlag = g_consoleFlag;

ProcessWndProc(hWnd, msg, wParam, lParam, pass, lresult);
Expand Down

0 comments on commit 03eae57

Please sign in to comment.