Skip to content

Commit

Permalink
forward enter presses on the keyboard to consoleuiview, so u can log …
Browse files Browse the repository at this point in the history
…in without pressing arrow
  • Loading branch information
wiktorwiktor12 committed May 28, 2024
1 parent 59e2b7e commit bb25818
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions ConsoleLogonHook/ui/ui_selectedcredentialview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,27 @@ void uiSelectedCredentialView::Begin()
}
}

static bool bPressedEnter = false;

void uiSelectedCredentialView::Tick()
{
if (GetAsyncKeyState(VK_RETURN))
{
if (!bPressedEnter)
{
bPressedEnter = true;

if (uiRenderer::Get()->activeWindow.get() == this) //only send an enter if we are active window
{
KEY_EVENT_RECORD rec;
rec.wVirtualKeyCode = VK_RETURN; //forward it to consoleuiview
globals::ConsoleUIView__HandleKeyInput((void*)(__int64(globals::ConsoleUIView) + 8), &rec);
}
}

}
else
bPressedEnter = false;
}

void uiSelectedCredentialView::Draw()
Expand Down

0 comments on commit bb25818

Please sign in to comment.