Login password not accepted, keyboard produces gibberish characters
My MacBook Air 2016 is not allowing me to login - when booting up it goes to ordinary password screen, but won’t accept valid password. If I press Enter with no password, it takes me to a different login screen with fields for both Name and Password. When I try to enter a username, it produces really weird characters - non-English language characters and punctuation, mathematical symbols etc. And the password field only accepts some keys, it produces a refusal beep for others but seemingly quite random.
I tried getting to safe mode but it is not cooperating - once it rebooted to safe mode but I still couldn’t login, and now I can’t even get back there.
So I feel I’m basically at the point of needing a factory reset but I’m hoping there are other options. Any wisdom much appreciated!
MacBook Air 13", macOS 10.14