I cannot log in due to changed keyboard layout

My (Danish) keyboard on my 2016 MacBook Pro has changed layout after crashing. My password contains a pipe charecter but this cannot be accessed via the normal way (alt + i) or the US Way (alt + 7).

How can I determine the keyboard layout or change it without logging in? It would also help if I could type in a non password input field to test. Is this possible?


Solution 1:

Method 1: Go into the Guest User(if it is there) and change the language.

Method 2: See Mac os X - locked outside my account (language!).

Method 3: Try booting into recovey mode(holding cmd+R at boot). Then you should be able to change the keyboard layout(in the menu bar).

Method 4: See https://superuser.com/q/871277.