This is an issue I've seen pop up in a few places, and it specifically seems to pertain to Widnows. It has been a persistent problem since 2021 at the least. So far, I can only recall this bug occurring as of Windows 11, and am unable to test if it's the same for Windows 10. I have noticed it happening since 2021, so it's definitely something deep within the OS that's causing problems.
Context
I am using a laptop, specifically Acer Nitro 7 (AN715-15).
Exact Windows OS version is irrelevant, it's been occurring for the past ~3 years and I've been up-to-date since. Only information that's relevant is it's on Windows 11.
Devices I'm using is irrelevant, since this issue occurs on ALL mice and keyboards.
The Problem
After disconnecting a USB mouse/keyboard a few times (seems to be about three times), the keyboard becomes unresponsive, being unable to type anything. Any additional mice/keyboards stop functioning too when plugged in.
What the Problem Isn't
it's not a power plan problem. I have already done all the power plan settings that I've seen copy-pasted in every single solution pertaining to this. I have already turned off selective suspend.
It's definitely not a device driver problem, I have already done driver troubleshooting, and if it was, other peripherals should have worked normally when plugged in upon the problem's inception, but once the Windows OS bug happens, it occurs for EVERY peripheral plugged in. (Note: I have not tested Linux, but other posts about the issue have claimed the problem is non-existent on Linux)
This is not an issue with USB ports. Plugging into different ports does nothing to remedy the issue.
This is not an issue with cables. In addition, my mouse stops responding, and that's using a RF USB device.
It's possible it's an issue with interception drivers[1][2], but I uninstalled the ones I could find. I've uninstalled the drivers for RawAccel, and uninstalled 3Dconnexion, which I do not use anymore, and don't have anything else in mind that could be intercepting inputs.
Observations
Oddly enough, the normal keys do not work, but media keys work like normal. I can't type any characters/digits/symbols, but I am fully able to pause/play media, mute, volume up/down. I am also using a split keyboard that utilizes QMK (a sort of firmware) and I can't type anything nor use modifiers, but am able to change keyboard layers and fully control media using the same keys that would normally type out alphanumeric characters. (characters don't type out anything, but layer change -> hit the same exact key, now set to controlling media, and it works like normal in that it now controls media)
Note how earlier I emphasized when plugged in. What is strange is that once the bug occurs, any mice/keyboards that were already plugged in work like normal, but should I attempt to unplug and re-plug them in, those devices now fail to operate. For instance, I disconnect my keyboard about ~3 times while my mouse it plugged in, and the keyboard now becomes unresponsive, but the mouse works fine. It's until I unplug and re-plug my mouse that it stops responding.
I recently bought a USB splitter in an attempt to be able to switch between feeding the split keyboard's connection between a console and the computer. The problem occurs when switching devices through the splitter, but what's odd is that I noticed USB flash drives work like normal, be it plugged in through the splitter or into the laptop's ports.
There was a suggestion about using sc query type=all in this post to find anything, but I couldn't find anything worthwhile personally. In addition, the post suggested that "Three times is what Windows will restart a crashed driver/service," but there is nothing exactly noted anywhere that could be a crashed driver.
One thing that I can confirm is that this issue does not occur whatsoever on the Xbox Series X that I have.
