Only return POLLIN if keyboard event added a character to the buffer

This commit is contained in:
pjht 2025-02-26 13:23:45 -06:00
parent 3c9e14fa81
commit 4801ca2e0b
Signed by: pjht
GPG Key ID: CA239FC6934E6F3A

View File

@ -114,10 +114,12 @@ fn process_keyboard_data() {
pc_keyboard::DecodedKey::RawKey(_) => (),
pc_keyboard::DecodedKey::Unicode(ch) => KEYPRESS_BUF.lock().push_back(ch),
}
if !KEYPRESS_BUF.lock().is_empty() {
for mut poll in POLLS.lock().drain(..) {
poll.reply(PollEvents::POLLIN);
}
}
}
}
fn main() {