• Hi all!



    I want to code a small plugin that does some usage statistics of the remote control or remote keyboard. Does anyone have an idea how all the key-events can be catched in Python? I found out that the /proc/bus/input/devices may be a way, but I would rather use Python... because of lack of C/Linux knowledge... :kissing_face:



    Best regards!

  • There are various versions of a Python skript named evdev.py (have a try at google), which do that job. But you have to comment out some lines that do ioctl calls which otherwise would generate IOErrors (22, invalid argument).


    These lines are affected:


    Code
    def readMetadata(self): 
    [...] 
    self.name = ioctl(self.fd, EVIOCGNAME_512, buffer) 
    [...] 
    values = struct.unpack("iiiii", ioctl(self.fd, EVIOCGABS_512 + number, buffer))


    The version I am using is attached. If someone of you out there has an idea why these IO exceptions occur...