About half the time when entering Ubuntu or resuming from sleep, my built-in laptop keyboard doesn't register any inputs or show up in xinput even though my keyboard always works on GRUB and Windows. Repeatedly unplugging and replugging some USB peripherals (USB hub, mouse, external hard drive) eventually reactivates the keyboard and makes it appear in xinput (as "AT Translated Set 2 keyboard" always with id=15, even if something else was id=15 previously). The keyboard still lights up even when inputs aren't being registered. I've been having this issue since first installing Ubuntu a week or two ago.
All of my drivers are up to date, and I'm on the latest version of Ubuntu. Disabling
intel_vbtn as outlined here: https://askubuntu.com/a/1282269/558457 also didn't fix the issue. Does anyone know about a possible cause or fix?