Only return POLLIN if keyboard event added a character to the buffer
This commit is contained in:
parent
3c9e14fa81
commit
4801ca2e0b
@ -114,8 +114,10 @@ fn process_keyboard_data() {
|
||||
pc_keyboard::DecodedKey::RawKey(_) => (),
|
||||
pc_keyboard::DecodedKey::Unicode(ch) => KEYPRESS_BUF.lock().push_back(ch),
|
||||
}
|
||||
for mut poll in POLLS.lock().drain(..) {
|
||||
poll.reply(PollEvents::POLLIN);
|
||||
if !KEYPRESS_BUF.lock().is_empty() {
|
||||
for mut poll in POLLS.lock().drain(..) {
|
||||
poll.reply(PollEvents::POLLIN);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user