I'm trying to control mplayer through the slave mode with a fifo, some commands as

echo "pt_step 1" >> fifo
echo "quit" >> fifo
echo "pause" >> fifo
echo "set_property volume 60" > fifo

Work perfectly but the key_down_event doesn't

echo "key_down_event DOWN" >> fifo
echo "key_down_event UP" >> fifo
echo "key_down_event <-" >> fifo
echo "key_down_event ->" >> fifo

Any idea of what I'm doing wrong?



It seems you need to send numeric keycodes to mplayer. For instance,

echo 'key_down_event 100' > /path/to/fifo

will toggle framedropping (the "d" key, 0x64 in hexadecimal). I found this by accident, but /usr/include/X11/keysymdef.h (and also xev which is hard to read though) will show the keycodes in hexadecimal, which you can convert to decimal e.g with galculator.

  • Wow, thanks for registering and answering!! Whenever I have time I´ĺl check it out – Vndtta Jun 1 '13 at 8:46
  • Your solution worked! the only problem was that I don't have the keysymdef.h file and xev showed the wrong keycodes :S. The solution was to make a loop writing to the fifo till I found the correct values – Vndtta Oct 2 '13 at 11:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.