mirror of
https://github.com/TomHarte/CLK.git
synced 2024-06-30 22:29:56 +00:00
Avoid posting redundant key events.
This commit is contained in:
parent
84f7d8dfc2
commit
373847e2b7
|
@ -96,6 +96,9 @@ Keyboard::Keyboard(Serial::Line<true> &output) : output_(output) {
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
void Keyboard::set_key_state(uint16_t key, bool is_pressed) {
|
void Keyboard::set_key_state(uint16_t key, bool is_pressed) {
|
||||||
|
if(pressed_[key] == is_pressed) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
pressed_[key] = is_pressed;
|
pressed_[key] = is_pressed;
|
||||||
output_.write<false>(
|
output_.write<false>(
|
||||||
HalfCycles(60),
|
HalfCycles(60),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user