Something similar has happened to me. When it has happened to me I press each modifier key (shift, alt, ctrl, FN, win, menu, etc...) and it usually fixes the problem.
Holding down the Ctrl Alt Shift keys on both the left and right side on the keyboard for 3-5 seconds used to be a (low/BIOS-level?) keyboard reset, at least on Windows.