input: Clear password buffer with escape key (#37)

This commit is contained in:
Siavash Askari Nasr 2024-02-21 11:01:52 +00:00 committed by GitHub
parent 7b15d34f0a
commit 277a377eb2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -454,6 +454,10 @@ void CHyprlock::onKey(uint32_t key) {
Debug::log(LOG, "Authenticating"); Debug::log(LOG, "Authenticating");
m_sPasswordState.result = g_pPassword->verify(m_sPasswordState.passBuffer); 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 { } else {
char buf[16] = {0}; char buf[16] = {0};
int len = xkb_keysym_to_utf8(SYM, buf, 16); int len = xkb_keysym_to_utf8(SYM, buf, 16);