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:
Dave Jones
2016-08-29 22:18:04 +01:00
parent c51f447800
commit 07c95598d1
2 changed files with 24 additions and 4 deletions

View File

@@ -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
===================