Using USB Keyboard

Plan C: Python evdev (ctypes)

Micah Dowty wrote very nice pure python evdev.

Install hid driver:

opkg update
opkg install kmod-input-core
opkg install     kmod-input-evdev
opkg install wget 
cd /tmp
wget https://www.dropbox.com/s/whnf5huyk39krqx/kmod-hid_3.8.3-1_ar71xx.ipk --no-check-certificate
rm /tmp/opkg-lists/*; opkg install kmod-hid_3.8.3-1_ar71xx.ipk
wget https://www.dropbox.com/s/2yegmen4rdy6uwm/kmod-hid-generic_3.8.3-1_ar71xx.ipk --no-check-certificate
opkg install kmod-hid-generic_3.8.3-1_ar71xx.ipk
opkg update
opkg install kmod-usb-hid
insmod  hid-generic
echo "hid-generic" >>/etc/modules.d/62-hid-generic

test keyboard driver:

cat /dev/input/event1  | hexdump

download Micah's code ( I clean a little):

cd /mnt/sda1
wget https://www.dropbox.com/s/uwy1d0lgawljf3b/evdev.py --no-check-certificate
chmod 755 evdev.py

Test code:

./evdev.py '/dev/input/event1'
<Event timestamp=1395255517.851952 type='EV_MSC' code=4 value=458756>
<Event timestamp=1395255517.851952 type='EV_KEY' code='KEY_A' value=1>
30