So it is about the Keyboard layout, not about detecting a connected keyboard, right?
The layout needs to be chosen by the user, b/c the physical
keyboard does not report how the keys are labeled, or have been re-labeled.
In MX Linux are 4 levels to choose a keyboard layout,
in case the default English US keyboard layout is not desired:
1) At LiveBoot menu, when going to install the system,
one can select the keyboard layout, together with language and timezone
which would be available for the Live-session.
2) When running the installer to install the system,
the first window offers keyboard-selection, in case the selection at LiveBoot menu was missed.
3) and even if this was not chosen,
one can run the system-keyboard selection tool to be fount within MX tools
4) And further, one can select instead of the system-keyboard layout another layout for
the user session, using the keyboard layout tool in Xfce settings.
Now tell us what is not working for you and why not?