Many thanks for your advice @BuZz. I modified the startup script as you mentioned and it still works.
My understanding is that BasiliskII should ever load the 'keycodes' file so the host keyboard layout (the one configured in Raspbian/RetroPie, here) is taken into account, whatever international layout it is. Without the 'keycodes' file, only US-layout would be recognized and typing from another host keyboard layout (i.e French AZERTY, German QWERTZ...) under Basilisk would produce weird result. If I understand well, the keycodes file contains the USB keycode for any environment BasiliskII has been built for (so, the Linux framebuffer, here).
By the way, loading or not this keycodes files every time BasiliskII starts is not necessarily the most important point. With your permission, I would rather suggest that there is something to fix somewhere, since BasiliskII doesn't open this file when it is told to do so from its basiliskii.cfg config file.