USB keyboard unplugs and plugs itself when a human approaches or steps away
Low-speed USB devices are allowed to have their cable to be unshielded. Some makers use these cheaper cables to reduce device's cost and have more flexible (user-friendly) cables. These cables are prone to external radio interference, including small ESD events that always happen, especially in dry-air winter time. With unshielded cable all interference goes straight into signal ground and causes USB disconnect event, and, since the cable/device is still there (connected), the driver will immediately re-enumerate the device. The effect also depends on how the USB connector shield is grounded on mainboard of PC, to the chassis or straight to signal ground.
Get a better keyboard and/or better PC.