You need to understand that the part of the code where you tried to "add the keys in the rpg_core.js" is a dictionary data structure called Input.keyMapper.
A "dictionary" is not a "function", it doesn't run any if statements or do any processing, it just stores data so that whenever it is asked for the "key" on the left, it spits out the "value" on the right. If you put 2 entries for the same key in it with different values, the later entry will just overwrite the earlier one.
Whenever the user presses a button down, the function Input._onKeyDown gets called (and when it is released, Input._onKeyUp get called). This function itself is already has all the information of the pressed button when it is called - it just checks to see whether the button's keycode exists in Input.keyMapper. This is the line that goes "var buttonName = this.keyMapper[event.keyCode]"*.
If it finds an entry, it fetches the value corresponding to the keycode in the keyMapper dictionary and then updates some other internal variables to remember it was pressed. Otherwise, if there's no entry for it in keyMapper, it basically just ignores the button press.
But keyMapper simply cannot store multiple values for the same key. So if you want the same keycode to give you different values based on user keyboard type, you need to modify _onKeyDown and _onKeyUp to check the user's keyboard type whenever a button that could have a different letter is pressed (or write a whole new function to do that, which is then called by _onKeyDown and _onKeyUp when it detects that button is pressed).
What I said you COULD do was basically make it so the entry for the button in Input.keyMapper is one value that just indicates "this key can have multiple values, please run code to check user keyboard and determine which one it is". And then, when _onKeyDown and _onKeyUp check it and receive that value, make it run the keyboard check and assign the correct letter based on the results.
But in truth, you don't actually need to touch keyMapper at all - you could also just not have an entry at all in keyMapper and directly modify _onKeyDown or _onKeyUp to perform the check every time it looks at Input.keyMapper and fails to find an entry for the keycode of a questionable button.
* This line of code means: check the "keyCode" of the button being pressed (all of the pressed button's data is in the "event" variable) and get the value associated with its entry from "keyMapper", and then assign the value of the entry to a new variable called "buttonName".
var isGermanKeyboard = //code to check user keyboard
does it automaticly detect keyboard layouts? it looks like you do a variable but I don't understand how it can check if its german oder english keybaord
No. You are meant to run your own function to check whether the keyboard is German and store the yes/no result in the variable.
The first code snippet that you posted was code meant for checking whether the keyboard was US or not, but tries to use the keyboard.getLayoutMap() function to check it, which as
@ATT_Turan pointed out doesn't work with RMMV, only in certain web browsers.
So you will have to find some other way to check what kind of keyboard the user has.
If nobody has done this before, you will probably need to write your own code for it. While I've never tried it myself and can't say with certainty what will work, you may want to check whether "event.key" when running Input._onKeyDown or Input._onKeyUp gives you different letters for different keyboard types.
If it does, you can use that in your code to differentiate between keyboard types.