Humm it is a known problem with retroarch about keyboard/gamepad management.
Maybe by deactivating all gamepads in retroarch and allocating keyboard on player could solved this issue... Don't know, must be tried.
You can ask to libretro/retroarch team/community, they will be more informed that me.
The have have a forum/irc channel.

If you find informations to solve this issue, make us a feedback 😉