1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-29 00:29:34 +00:00

Avoid posting redundant key events.

This commit is contained in:
Thomas Harte 2021-11-28 05:31:00 -05:00
parent 84f7d8dfc2
commit 373847e2b7

View File

@ -96,6 +96,9 @@ Keyboard::Keyboard(Serial::Line<true> &output) : output_(output) {
}*/
void Keyboard::set_key_state(uint16_t key, bool is_pressed) {
if(pressed_[key] == is_pressed) {
return;
}
pressed_[key] = is_pressed;
output_.write<false>(
HalfCycles(60),