zeth / inputs

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

OSError when turning on gamepad #86

Open QopyKat opened 4 years ago

QopyKat commented 4 years ago

Raspbian GNU/Linux 9 (stretch) Python 3.5.3 Logitech Wireless Gamepad F710

Everything works just fine except that i get this error when switching the gamepad on/off while waiting for an event from get_gamepad. It might help to know that when the gamepad is turned off the device is detected as "Logitech Gamepad F710" and when it is turned on the devices id detected as "Logitech Logitech Cordless RumblePad2"

Traceback (most recent call last): File "get_gamepad.py", line 5, in events = get_gamepad() File "/usr/local/lib/python3.5/dist-packages/inputs.py", line 3679, in get_gamepad return gamepad.read() File "/usr/local/lib/python3.5/dist-packages/inputs.py", line 2517, in read return next(iter(self)) File "/usr/local/lib/python3.5/dist-packages/inputs.py", line 2687, in iter event = self._do_iter() File "/usr/local/lib/python3.5/dist-packages/inputs.py", line 2495, in _do_iter data = self._get_data(read_size) File "/usr/local/lib/python3.5/dist-packages/inputs.py", line 2477, in _get_data return self._character_device.read(read_size) OSError: [Errno 19] No such device