1

I would like to know if I could find a way to bind a combo like the "hadouken" (Hadouken is a combination of movement of a joystick: down, down-right, right + button ) of street fighter to make an easter egg on my emulationstation of retropie. I've a .sh script which inside I've the instruction:

mpg123 -Z /home/pi/bgm/*.mp3 >/dev/null 2>&1 &

I use that to play random mp3 from bgm folder, but i would like exactly use "hadouken" combination to launch/stop that .sh. Any idea or suggestion?

3
  • You will have to sell us more about hadouken. Sep 5, 2018 at 15:30
  • Hadouken is a combination of movement of a joystick: down, down-right, right + button
    – tommy
    Sep 5, 2018 at 15:47
  • Maybe there is a way to record which button has been pressed ?
    – tommy
    Sep 5, 2018 at 18:45

1 Answer 1

0

You probably want the application "xdotool":

$ xdotool key F2 - to send F2 to the screen

$ xdotool key 1 - to send number 1 to the screen

More use cases:

http://manpages.ubuntu.com/manpages/trusty/man1/xdotool.1.html

4
  • Does xdotool could map also a joystick?
    – tommy
    Sep 5, 2018 at 19:35
  • @tommy - for this you need to use the "xev" tool - to see the sequence of commands/events sent by the joystick to X, and properly emulate them. Run "xev" and press the keys/buttons of the joystick you want to send to X.
    – FabioM
    Sep 6, 2018 at 23:25
  • Ok i can try xev, but it's possible then write down a sequence identified on a txt or similar?
    – tommy
    Sep 7, 2018 at 6:13
  • seems that "xev" tool not available on raspbian
    – tommy
    Sep 7, 2018 at 11:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .