zeth / inputs

Cross-platform Python support for keyboards, mice and gamepads
BSD 3-Clause "New" or "Revised" License
269 stars 87 forks source link

Keyboard devices dont show up in Docker / VM #28

Open madhavajay opened 6 years ago

madhavajay commented 6 years ago

It seems that for some reason the inputs.devices.keyboards is empty in Docker and in Virtual Machines. I have tried running xinput and can see that there are virtual devices but there are no /dev/inputs which is what the library relies on.

See screenshot here: https://imgur.com/a/8z6cKev

Any ideas on how to fix this, or is it just not possible? I know you can run xinputs and get the state of key presses on the virtual devices so I guess theres the chance of writing a different code path to poll this utility but that seems ugly.

zeth commented 6 years ago

Fascinating.

Have you tried something like this? https://dummdida.tumblr.com/post/121087781445/re-udev-events-in-a-container

madhavajay commented 6 years ago

Im not entirely sure what that is, but my guess is that won't work on Mac / Windows where the Host is just a hidden VM?

The strange thing is this happens in VM's too so im surprised im the first person to notice that there are no /dev/inputs on VMs or Docker containers...?