So first i'm a real raspberry pi and python noob... so apologies if this is way more straight forward then I seem to be making it. Essentially I'm trying to map a single push button so that when it is pushed it mimics the left shift key being pushed on a keyboard. It also will light up an LED.
Button to LED is working without any issue. However I can't seem to get anywhere with mapping to left shift.
After a bit of research I found uinput and got that all setup, and tried including it in a script called Howl.py when I run this I get the following:
Code: Select all
pi@raspberrypi ~/Desktop/Python $ modprobe uinput
pi@raspberrypi ~/Desktop/Python $ sudo python2 Howl.py
Traceback (most recent call last):
File "Howl.py", line 11, in <module>
device = uinput.Device(events)
File "/usr/local/lib/python2.7/dist-packages/uinput/__init__.py", line 167, in __init__
ev_type, ev_code = ev_spec[:2]
TypeError: 'int' object has no attribute '__getitem__'Thanks!