To use a German keyboard in emulated keyboard mode, start MAME e.g. with (key map path on Linux):
mame cpc6128 -keymap -keymap_file /usr/share/sdlmame/keymaps/km-dekm_de_LINUX.txtmap
You can also put these settings in your mame.ini like this:
keymap 1
keymap_file /usr/share/sdlmame/keymaps/km-dekm_de_LINUX.txtmap
In emulated mode, keys can also be remapped in the emulator menu. First press ''Scroll Lock'' to enable the MAME control keys, then ''Tab'' to open the menu, and finally select ''Input (this system)''. ''Return, Esc'' clears an assigned key.