On 10/6/26 12:56, Marc-André Lureau wrote:
Add per-handler LED state and a NotifierList for UI backends to
subscribe to LED changes.
Devices call qemu_input_handler_set_led() to store their LED state and
notify backends. Notify also on focus change, or list update.
Note: I considered conflating mouse-mode & led-state changes, but those
are quite different events (from different source kinds etc) and we may
want to improve the internal implementation.
Signed-off-by: Marc-André Lureau <[email protected]>
---
include/ui/input.h | 5 +++++
ui/input.c | 49 +++++++++++++++++++++++++++++++++++++++++++++----
2 files changed, 50 insertions(+), 4 deletions(-)
+int qemu_input_get_led(QemuConsole *con)
+{
+ QemuInputHandlerState *s;
+
+ s = qemu_input_find_handler(INPUT_EVENT_MASK_KEY, con);
Hmm can @con be NULL?
In SPICE (patch 20) you do:
int ledstate = qemu_input_get_led(NULL);
+ if (s) {
+ return s->ledstate;
+ }
+ return 0;
+}