mirror of
https://github.com/KevinMidboe/python-gpiozero.git
synced 2025-12-08 20:39:01 +00:00
Fix #289
Tweak the second keyboard robot recipe so it detects keyboards and doesn't throw exceptions on unknown keys. Also add a note to the recipe that it won't work over remote connections like SSH.
This commit is contained in:
@@ -345,11 +345,16 @@ Use up/down/left/right keys to control a robot:
|
||||
recipe will *not* work in environments like IDLE.
|
||||
|
||||
If you prefer a version that works under IDLE, the following recipe should
|
||||
suffice, but will require that you install the evdev library with ``sudo pip3
|
||||
install evdev`` first:
|
||||
suffice:
|
||||
|
||||
.. literalinclude:: examples/robot_keyboard_2.py
|
||||
|
||||
.. note::
|
||||
|
||||
This recipe uses the third-party ``evdev`` module. Install this library
|
||||
with ``sudo pip3 install evdev`` first. Be aware that ``evdev`` will only
|
||||
work with local input devices; this recipe will *not* work over SSH.
|
||||
|
||||
|
||||
Motion sensor robot
|
||||
===================
|
||||
|
||||
Reference in New Issue
Block a user