Did you try to go into the uefi setting to see if the keyboard was functioning as expected? This will eliminate any software issues with drivers and OS. you can go into the security/ setup password to type. If it fails it’s a hardware issue, if it works then it’s software (probably).