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

View file

@ -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);