#!/usr/bin/python keys = { 0x00 : "", 0x03 : "1", 0x09 : "2", 0x0f : "3", 0x04 : "4", 0x0a : "5", 0x10 : "6", 0x05 : "7", 0x0b : "8", 0x11 : "9", 0x06 : "*", 0x0c : "0", 0x12 : "#", 0x02 : "yes", 0x07 : "+", 0x0e : "no", 0x01 : "left", 0x13 : "up", 0x16 : "down", 0x0d : "right", 0x19 : "vol+", 0x1c : "vol-", 0x1b : "mute", } file = open( "/dev/hidraw0", "w+b" ); def getKey(): buf = file.read(8) return keys[ord(buf[1])] while( 1 ): k = getKey(); print k file.close();