mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-08-22 07:01:30 +00:00
[client/idd] input: synchronize keyboard LEDs
Report guest HID keyboard LED state from LGInput to LGIdd and publish it with the LGMP input endpoint status. Forward SPICE modifier updates through the same provider state so evdev can synchronize physical keyboard LEDs across transport changes and reconnects. Bump the versioned pipe and KVMFR input status contracts for the new feedback state. Accept earlier LGMP input status versions without LED feedback so the client retains input while the guest driver is being upgraded.
This commit is contained in:
@@ -23,6 +23,9 @@
|
||||
|
||||
#include "interface/input.h"
|
||||
|
||||
typedef void (*LGInputKeyboardLEDsFn)(void * opaque,
|
||||
bool valid, uint8_t leds);
|
||||
|
||||
void lgInput_init(void);
|
||||
void lgInput_free(void);
|
||||
|
||||
@@ -35,6 +38,11 @@ void lgInput_useTransport(bool enable);
|
||||
|
||||
bool lgInput_available(void);
|
||||
bool lgInput_supports(LG_InputSupport support);
|
||||
/* The listener is called synchronously with the current guest LED state and
|
||||
* later from transport threads whenever it changes. The callback must not
|
||||
* call back into the input layer. */
|
||||
void lgInput_setKeyboardLEDsListener(
|
||||
LGInputKeyboardLEDsFn callback, void * opaque);
|
||||
|
||||
bool lgInput_keyDown(int key);
|
||||
bool lgInput_keyUp(int key);
|
||||
|
||||
@@ -30,10 +30,22 @@ typedef enum LG_InputSupport
|
||||
}
|
||||
LG_InputSupport;
|
||||
|
||||
enum
|
||||
{
|
||||
LG_KEYBOARD_LED_NUM_LOCK = 0x1,
|
||||
LG_KEYBOARD_LED_CAPS_LOCK = 0x2,
|
||||
LG_KEYBOARD_LED_SCROLL_LOCK = 0x4,
|
||||
LG_KEYBOARD_LED_COMPOSE = 0x8,
|
||||
LG_KEYBOARD_LED_KANA = 0x10,
|
||||
};
|
||||
|
||||
typedef struct LG_InputStatus
|
||||
{
|
||||
bool available;
|
||||
uint32_t generation;
|
||||
/* USB HID keyboard LED bits reported by the guest. */
|
||||
bool keyboardLEDsValid;
|
||||
uint8_t keyboardLEDs;
|
||||
}
|
||||
LG_InputStatus;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user