From 277a377eb2e858fe69c1262d2a965cf573e575b9 Mon Sep 17 00:00:00 2001 From: Siavash Askari Nasr Date: Wed, 21 Feb 2024 11:01:52 +0000 Subject: [PATCH] input: Clear password buffer with escape key (#37) --- src/core/hyprlock.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/hyprlock.cpp b/src/core/hyprlock.cpp index 1de64e1..09c7d20 100644 --- a/src/core/hyprlock.cpp +++ b/src/core/hyprlock.cpp @@ -454,6 +454,10 @@ void CHyprlock::onKey(uint32_t key) { Debug::log(LOG, "Authenticating"); m_sPasswordState.result = g_pPassword->verify(m_sPasswordState.passBuffer); + } else if (SYM == XKB_KEY_Escape) { + Debug::log(LOG, "Clearing password buffer"); + + m_sPasswordState.passBuffer = ""; } else { char buf[16] = {0}; int len = xkb_keysym_to_utf8(SYM, buf, 16);