3 Replies Latest reply on Mar 14, 2016 11:19 AM by DiegoV_Intel

    Simulate Key Press event in Python [Edison]

    js3ph

      I am trying to get an existing Python script which starts playing a song via mplayer to be able to interact with its keyboard input functionality (e.g. space to play/pause, arrow keys to ffw/rwd).

      I have tried using python-uinput but running the example keyboard script does nothing (no errors). I executed modprobe input before running too.

      I also tried python-evdev (after installing some other necessary dependancies), ran its example code and again there was no output, and also no errors.

      I'm wondering if there is something that's causing both of these to not work the way they would on a full Linux build? Just a thought; really not sure what's going on. Any help is much appreciated, thanks!

      I'm also open to other suggestions on how to control mplayer from a python script, besides simulating keyboard events.