TL;DR: keys created by gpio-keys are handled very differently compared to a proper keyboard, and I'm not sure why.
But i want to use gpio-keys for controlling standalone mpv, and that requires at least key repeating or proper key state reporting.
So, any help with a custom dtoverlay with EV_REP set, or explanations how this works would be really great.
Longer story is, I want a RPi-based videoplayer with basic controls: 3 GPIO buttons, play/pause and next with previous that also work as rewind when held. It was supposed to be simple project for a day or two...
The MPV side was relatively easy, I just added my lua script to handle rewind and some additional OSD.
Same was with Linux aspect of it, systemd unit took care of headless autostart and everything.
The Raspberry side, on the other hand, turned out to be a real showstopper...
Turns out that keys created by gpio-keys do not repeat. Even worse, MPV sees them only as pressed, nothing more, even though evtest reports two events for pressing and releasing the key. And, from what I gathered on the internet, I can't do anything with that even in graphical environment, which was my backup, despite how much it bothers be to start whole graphics for just a video player.
The only way to solve it that I found is to compile a custom dtoverlay where I add that EV_REP tag to get repeating keys, and that is outside of my capabilities. Even with neural networks, which where especially unhelpful last couple of days)
So, can someone help me with writing a custom dtoverlay to define 3 GPIO buttons? Or, even better, explain to me why I am an idiot and how there was an easy solution all this time.
But i want to use gpio-keys for controlling standalone mpv, and that requires at least key repeating or proper key state reporting.
So, any help with a custom dtoverlay with EV_REP set, or explanations how this works would be really great.
Longer story is, I want a RPi-based videoplayer with basic controls: 3 GPIO buttons, play/pause and next with previous that also work as rewind when held. It was supposed to be simple project for a day or two...
The MPV side was relatively easy, I just added my lua script to handle rewind and some additional OSD.
Same was with Linux aspect of it, systemd unit took care of headless autostart and everything.
The Raspberry side, on the other hand, turned out to be a real showstopper...
Turns out that keys created by gpio-keys do not repeat. Even worse, MPV sees them only as pressed, nothing more, even though evtest reports two events for pressing and releasing the key. And, from what I gathered on the internet, I can't do anything with that even in graphical environment, which was my backup, despite how much it bothers be to start whole graphics for just a video player.
The only way to solve it that I found is to compile a custom dtoverlay where I add that EV_REP tag to get repeating keys, and that is outside of my capabilities. Even with neural networks, which where especially unhelpful last couple of days)
So, can someone help me with writing a custom dtoverlay to define 3 GPIO buttons? Or, even better, explain to me why I am an idiot and how there was an easy solution all this time.
Statistics: Posted by Karakurt — Wed Jul 02, 2025 2:44 pm