From bb25818d5e6cc96423e56bd4eebcc95c0bff0833 Mon Sep 17 00:00:00 2001 From: wiktorwiktor12 Date: Tue, 28 May 2024 22:09:32 +0100 Subject: [PATCH] forward enter presses on the keyboard to consoleuiview, so u can log in without pressing arrow --- .../ui/ui_selectedcredentialview.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ConsoleLogonHook/ui/ui_selectedcredentialview.cpp b/ConsoleLogonHook/ui/ui_selectedcredentialview.cpp index f1a49c8..4cd2129 100644 --- a/ConsoleLogonHook/ui/ui_selectedcredentialview.cpp +++ b/ConsoleLogonHook/ui/ui_selectedcredentialview.cpp @@ -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()