We can not consider the qemu led state to be reliable. It by default has 50ms of delay, so if we want to achieve something reliable, this won't do.
We need to keep our own internal state, and consider it as reliable. We update it immediately after receiving the key presses, meaning that this is now the future state of the guest.
When we receive a keymap event, we check against this 'ideal' state and only update the guest if we 'counted' that it won't have the correct state.
When the guest notifies its change, the modifiers_watch is supposed to fix any wrong state.
ff9c8d49 inputs-channel: Attempt to have a reliable led state
AUTHORS | 2 ++
server/inputs-channel.c | 69 +++++++++++++++++++++++++++++++++++++++----------
2 files changed, 57 insertions(+), 14 deletions(-)