Getting ready

Perform the following steps to install uInput:

  1. First, we need to download uInput.

You will need to download the uInput Python library from GitHub (~50 KB) using the following commands:

wget https://github.com/tuomasjjrasanen/python-uinput/archive/master.zip
unzip master.zip
  

The library will unzip to a directory called python-uinput-master.

  1. Once completed, you can remove the ZIP file using the following command:
rm master.zip  
  1. Install the required packages using the following commands (if you have installed them already, the apt-get command will ignore them):
sudo apt-get install python3-setuptools python3-dev
sudo apt-get install libudev-dev  
  1. Compile and install uInput using the following commands:
cd python-uinput-master ...

Get Raspberry Pi 3 Cookbook for Python Programmers - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.