Then I wrote a little python script in order to map my buttons and trigger some uinput keyboard events.
from time import sleep
import RPi.GPIO as GPIO
keypad = uinput.Device([uinput.KEY_N])
pause = .1
I launch the script as admin (needed for GPIO python lib).
The button press detection works without problem.
When I’m in console, I can see ‘n’ ar input. ‘n’ key is mapped to the “next shader” function in retroarch, this works with a usb keyboard… But not with my buttons.
Somehow, my script is only effective in console. As long as I launch emulstation or retroarch, it fails.
Help would be much appreciated. I can’t figure it out and I really want to implement this with python which should bring a great flexibility to my project !
Necessary and Functional
These cookies are placed to make it possible to analyze this website (with Google Analytics) and optimize for the purpose of a.o. the usability.
Cookie names: _ga, _gat, _gid
These cookies are placed to show advertisements (of Google AdSense) and to get these close to your interest.
Cookie names: id, IDE, FLC, DSID, SNID, NID
These cookies are required to show the cookie notification bar, remember your cookie acceptance choice and apply this choice.
Cookie names: privacy_embeds, wpca_consent, woocommerce_cart_hash, woocommerce_items_in_cart, wp_woocommerce_session_, wp-settings-1, wp-settings-time-1