In this section, we focus on sharing a locally attached input device with a guest virtual machine.
Since version 7.4.0, Libvirt added a low-latency local-only way to share an input device with a guest, using the Linux evdev event interface.
ls /dev/input/by-id/* | grep event | grep -v if
/dev/input/by-id/usb-Corsair_CORSAIR_HARPOON_RGB_PRO_Gaming_Mouse_1902B02BAF5E04655DEB612AF5001C05-event-mouse
/dev/input/by-id/usb-Logitech_G513_RGB_MECHANICAL_GAMING_KEYBOARD_156930783132-event-kbd
/dev/input/by-id/usb-Logitech_USB_Keyboard-event-kbd
/dev/input/by-id/usb-Logitech_USB_Optical_Mouse-event-mouse
cat /dev/input/by-id/usb-Logitech_G513_RGB_MECHANICAL_GAMING_KEYBOARD_156930783132-event-kbd
��c $
��c���c���c�$��c�$��c��c��c
<device>
section:<input type='evdev'>
<source dev='/dev/input/by-id/usb-Logitech_G513_RGB_MECHANICAL_GAMING_KEYBOARD_156930783132-event-kbd' grab='all' repeat='on'/>
</input>
Press Left Ctrl + Right Ctrl simultaneously to switch your devices between the guest and the host.