moonlight-stream / moonlight-embedded

Gamestream client for embedded systems
https://github.com/moonlight-stream/moonlight-embedded/wiki
GNU General Public License v3.0
1.51k stars 326 forks source link

Mouse emulation support for evdev #822

Closed TheChoconut closed 3 years ago

TheChoconut commented 3 years ago

Description This PR adds support for mouse emulation mode on game controllers. It is only implemented in evdev input backend. This feature already exists on moonlight-android and moonlight-qt and this code is inspired by the implentation on moonlight-qt.

This PR doesn't implement mouse emulation for SDL and X11 input backends, as I have no devices for testing these kinds of implementations.

Because moonlight-qt uses math libraries for pow() function, I also had to link moonlight against libm.

Purpose Game controller can now be emulated as a mouse using evdev input backend. Mouse emulation is toggled by long pressing Start button. The feature works similarly to moonlight-qt's implementation.

It has been tested on a Raspberry PI and an Amlogic box.

cgutman commented 3 years ago

Thanks!