PSP + GPIO Buttons Raspbian Kodi

Hello everyone !

I encounter a problem regarding the buttons in Kodi. The buttons aren’t working even tho’ it’s working on the “desktop” and retropie.

I put a Pi Zero W into a PSP. Connected the GPIO to the controls of the PSP. I then installed a Raspbian Image. I apt-get install kodi to get kodi. And also installed Retropie manually using this link.
I use retrogame.cfg file to make the buttons work. And copy the retrogame in /usr/local/bin/retrogame (both files has been given to me so I don’t really know thing about them, sorry).

Code:
# Sample configuration file for retrogame.
# Really minimal syntax, typically two elements per line w/space delimiter:
# 1) a key name (from keyTable.h; shortened from /usr/include/linux/input.h).
# 2) a GPIO pin number; when grounded, will simulate corresponding keypress.
# Uses Broadcom pin numbers for GPIO.
# If first element is GND, the corresponding pin (or pins, multiple can be
# given) is a LOW-level output; an extra ground pin for connecting buttons.
# A '#' character indicates a comment to end-of-line.
# File can be edited "live," no need to restart retrogame!

# Here's a pin configuration for the PSPi v2 project:

UP         23  # Up
DOWN       27  # Down
LEFT       22  # Left
RIGHT      17  # Right
Q          19  # Square
ENTER      16  # X
Y          20  # Triangle
ESC        26  # Circle
LEFTCTRL   24  # Left Trigger
RIGHTCTRL  21  # Right Trigger
S          12  # Start
D           6  # Select
VOLUMEDOWN 25  # Volume Down
VOLUMEUP    5  # Volume Up

# For configurations with few buttons (e.g. Cupcade), a key can be followed
# by multiple pin numbers.  When those pins are all held for a few seconds,
# this will generate the corresponding keypress (e.g. ESC to exit ROM).
# Only ONE such combo is supported within the file though; later entries
# will override earlier.

I checked several post about the subject but I can’t make it work :
Kodi forum post
Kodi forum post 2

When I start the PSP I end up on the shell. From there I just use the Up button to get the last lines. I can enter kodi like that. Once there the buttons aren’t working. When I start emulationstation or StartX it’s working fine. It looks like the buttons are well “simulated” on those like I would use the keyboard but not in Kodi

Can someone help me to figure out how to get that working in Kodi ?

Thanks all