This uinput Go binding permits to generate gamepad, mouse and keyboard events under Linux
Most of the constants and structures are extracted with c-for-go.
This is a Work in Progress, the code is not yet documented nor tested.
go get github.com/ynsta/uinputcd ${GOPATH}/src/github.com/ynsta/uinput/examples
go build gamepad.goThe user must have the permission to write to /dev/uinput, the configuration is distribution specific but should be similar to this :
- Add your user to the
inputgroup:sudo gpasswd --add $USER input - Create
/etc/udev/rules.d/99-uinput.ruleswith:KERNEL=="uinput", MODE="0660", GROUP="input", OPTIONS+="static_node=uinput"
- Reload udev
sudo udevadm control --reload