You need to look for a remote that have the buttons you need. For me all the BT remotes I have (with dongle) just works.
like:
import evdev
import time
import subprocess
import asyncio
import struct
import os
import constants
from evdev import InputDevice, categorize, ecodes
DEVICENAME = "ZYSD.Ltd HCY RC"
EV_VAL_PRESSED = 1
EV_VAL_RELEASED = 0
devices = [evdev.InputDevice(path) for path in evdev.list_devices()]
async def print_events(device):
global STATUS
async for event in device.async_read_loop():
if event.type == ecodes.EV_KEY:
if event.value == EV_VAL_PRESSED:
print(evdev.categorize(event))
try:
print("You Pressed: " + ecodes.KEY[event.code])
except:
print("You Pressed: " + ecodes.KEY[event.code][1])
if event.code == constants.KEY_ENTER: # KEY_ENTER
command = 'volumio toggle'
elif event.code == constants.KEY_PLAYPAUSE: # KEY_PLAYPAUSE
command = 'volumio toggle'
elif event.code == constants.KEY_LEFT: # KEY_LEFT
command = 'volumio previous'
elif event.code == constants.KEY_RIGHT: # KEY_RIGHT
command = 'volumio next'
elif event.code == constants.KEY_UP: # KEY_UP
command = 'bash /home/volumio/scripts/brightness.sh up'
elif event.code == constants.KEY_DOWN: # KEY_DOWN
command = 'bash /home/volumio/scripts/brightness.sh down'
elif event.code == constants.KEY_PAGEUP: # KEY_PAGEUP
command = 'node /data/plugins/user_interface/randomizer/randomTracks'
elif event.code == constants.KEY_PAGEDOWN: # KEY_PAGEDOWN
command = 'node /data/plugins/user_interface/randomizer/randomAlbum'
elif event.code == constants.KEY_VOLUMEDOWN: # KEY_VOLUMEDOWN
command = 'volumio volume minus'
elif event.code == constants.KEY_VOLUMEUP: # KEY_VOLUMEUP
command = 'volumio volume plus'
elif event.code == constants.KEY_BACK: # KEY_BACK
command = 'volumio clear'
elif event.code == constants.KEY_MUTE: # KEY_MUTE
command = 'volumio volume toggle'
elif event.code == constants.KEY_BACKSPACE: # KEY_BACKSPACE
command = 'volumio clear'
elif event.code == constants.KEY_VOICECOMMAND: # KEY_VOICECOMMAND
command = 'python3 /home/volumio/scripts/radioplaylist.py'
elif event.code == constants.KEY_COMPOSE: # KEY_COMPOSE
command = 'volumio random'
process = subprocess.Popen(command.split(), stdout=subprocess.PIPE)
for device in devices:
dev = InputDevice(device.path)
if dev.name.find(DEVICENAME) >= 0:
print(device.path, dev.name)
asyncio.ensure_future(print_events(device))
loop = asyncio.get_event_loop()
loop.run_forever()
or: