Any chance the issue is with the keyboard? Is it wireless and have you tried the old timey kind, reconnecting cables & using different ports-that sort of thing?
Harv 27" i7 iMac (10.13.6), iPhone Xs Max (12.1)
Those who can make you believe absurdities can make you commit atrocities. ~Voltaire