jevgienij Posted January 5, 2020 Posted January 5, 2020 I have this cheap bluetooth multimedia controller with 5 keys (play, prev, next, vol up, vol down). It's all connected and key presses are recognised: [root] [~] # showkey kb mode was UNICODE [ if you are trying this under X, it might not work since the X server is also reading /dev/console ] press any key (program terminates 10s after last keypress)... keycode 164 press keycode 164 release How do I go from here? How do I make this 164 key press to run "mpc toggle" command? It's an Orange Pi PC+ and Armbian 5.90. This is a console-only machine. No any X window system (most of the keybind solutions I've found were X related).
arox Posted January 5, 2020 Posted January 5, 2020 The easier way is probably to use "triggerhappy". But could you tell me what is your "cheap bluetooth multimedia controller" (if I wanted to buy one).
jevgienij Posted January 5, 2020 Author Posted January 5, 2020 https://aliexpress.com/item/32891411315.html I'll take a look at triggerhappy. Thanks!
arox Posted January 5, 2020 Posted January 5, 2020 showkey show keycodes and not keysyms but "thd --dump /dev/input/event*" will tell you".
arox Posted January 5, 2020 Posted January 5, 2020 My personal experience is that keeping (classical) BT connection is too power hungry for batteries. So The device must disconnect after a few seconds. With devices such PS2 remote (if I force disconnection), the first press is lost and the (re)connection delay is longer than one second. Please tell me if you get better results.
jevgienij Posted January 6, 2020 Author Posted January 6, 2020 It's just like you said. The first press is lost and reconnection takes more than one second. But that I can live with.
Recommended Posts