wiki/gofurther/evdev.md

37 lines
1012 B
Markdown
Raw Normal View History

2022-08-13 00:26:05 +00:00
---
title: Share an input device with a guest using evdev
description:
published: true
2022-08-25 10:40:46 +00:00
date: 2022-08-25T10:40:44.666Z
2022-08-13 00:26:05 +00:00
tags:
editor: markdown
dateCreated: 2022-08-13T00:26:02.801Z
---
2022-08-25 10:40:46 +00:00
# Share an input device
2022-08-13 00:26:05 +00:00
2022-08-25 10:40:46 +00:00
> *Input grabbing on Wayland doesn't currently work as expected. Destkop environments based on the X session manager may work better in this regard*
{.is-warning}
There are multiple ways to share an input device with a virtual machine.
## Event device
Event device or simply `evdev` is a generic input event interface that is part of the Linux kernel.
The following is a XML snippet example for sharing a mouse and a keyboard.
2022-08-13 00:26:05 +00:00
```
<input type='evdev'>
<source dev='/dev/input/by-path/platform-i8042-serio-1-event-mouse/'>
</input>
<input type='evdev'>
<source dev='/dev/input/by-path/platform-i8042-serio-0-event-kbd' grab='all' repeat='on'/>
</input>
2022-08-25 10:40:46 +00:00
```
Replace the `platform-i8042-serio-1-event-mouse` value with the value under `/dev/input/by-path/*` or `/dev/input/by-id/*`