[GUIDE] Keyboard shortcuts with triggerhappy

I have configured Volumio (3.179 on RPi4) for the OSMC remote control. image
here is my /etc/triggerhappy/tiggers.d/audio.conf

#VOLUMIO TRIGGERHAPPY CONFIGURATION FILE

#MUTE TOGGLE
KEY_ENTER 1 /usr/local/bin/volumio volume toggle

#VOLUME UP
KEY_EQUAL 1 /usr/local/bin/volumio volume plus
KEY_EQUAL 2 /usr/local/bin/volumio volume plus

#VOLUME DOWN
KEY_MINUS 1 /usr/local/bin/volumio volume minus
KEY_MINUS 2 /usr/local/bin/volumio volume minus

#PLAY PAUSE TOGGLE
KEY_PLAYPAUSE 1 /usr/local/bin/volumio toggle

#STOP
KEY_STOP 1 /usr/local/bin/volumio stop

#CLEAR
KEY_ESC 1 /usr/local/bin/volumio clear

#NEXT
KEY_RIGHT 1 /usr/local/bin/volumio next

#PREVIOUS
KEY_LEFT 1 /usr/local/bin/volumio previous

#SEEK FORWARD
KEY_UP 1 /usr/local/bin/volumio seek plus

#SEEK BACKWARD
KEY_DOWN 1 /usr/local/bin/volumio seek minus

#REPEAT
KEY_C 1 /usr/local/bin/volumio repeat

#RANDOM
KEY_I 1 /usr/local/bin/volumio random

A couple of points I learned that are not in this thread:
to restart the service in V3 you need to run:

sudo systemctl restart triggerhappy

Not all events are on event0 so if you want to see all the button codes you need to run

sudo thd --dump /dev/input/event*

The volume control uses the step defied in the regular settings menu. If you use my config you should set the stepsize to 1 so that a single click on the volume up or down changes the volume by one increment, but pressing and holding gives a smooth increase or decrease for as long as it is held.

2 Likes