Sample Header Ad - 728x90

X11, IR receiver, map remote keys to media keycodes

0 votes
0 answers
65 views
I set up an IR receiver with ir-keytable to be able to control some audio player from an remote. It works but I had to use some weird available key codes which were correctly caught by keyboard custom shortcuts. More specific: My OS is Linux Mint XFCE. I use an USB IR receiver AIM IR605Q setup with ir-keytable. I mapped "play key" from remote with "KEY_PLAYPAUSE" key code and it works immediately. I think audio player get this standard media play/pause event from OS. If I try to map "next song key" from remote with "KEY_NEXT" (or "KEY_NEXTSONG") it never works. KEY_NEXT event never fires anything. But when I launch ir-keytable tests, the key-up is seen and "KEY_NEXT" code is properly shown. By the way, my laptop keyboard has a media key "next song" which works as expected. My work-around is to use "KEY_CLOSE" for instance instead of KEY_NEXT (in remote config file read by ir-keytable), and then with a custom keyboard shortcut, I catch it and launch audio client with option --next. This is not amazing, but it works... I looked for hours without success to understand why I can't use right key codes (these codes are less than 8 bits...). (By the way, I first tried LIRC with no more success.)
Asked by TanaT (1 rep)
Oct 21, 2024, 08:42 AM