FRC4564 / Xbox

Python class to support xbox 360 controller under Linux on RaspberryPi
129 stars 35 forks source link

Opening this xbox.py closes file event14 and js0 in /dev/input #3

Closed aabs7 closed 7 years ago

aabs7 commented 7 years ago

Can we have a way to not close file event14 and js0 in /dev/input

FRC4564 commented 7 years ago

I don't have a simple answer for you on this issue. My code relies on 'xboxdrv' which is grabbing hold of js0. A quick read through the documentation for that driver suggests that adding the option --evdev-no-grab to the call will keep it from making that connection. Just add this option to the xboxdrv subprocess call that's in the init method of the Xbox class. Here's the line of code I'm referring to showing the option added:

self.proc = subprocess.Popen(['xboxdrv','--no-uinput','--detach-kernel-driver','--evdev-no-grab'], stdout=subprocess.PIPE)

Not sure if this will work for you, but certainly worth a try. If that fails, you might glean something from the full docs on all of the xboxdrv options.