If the keyboard has the same issue with other computers, not connected through a KVM, then this really sounds like to me that there is some sort of conductive material getting in the way periodically, like a small drop of water or something of the sort, within the keyboard.
If it works correctly, then it could be a problem with the KVM forwarding the keyboard signals.
Because we are using 2 different components here which could be the source of the fault, I would recommend attempting to isolate which component is failing by eliminating one of the variables. Either replace the keyboard or the KVM and and go about your work as usual to see if the failure ever happens again.
[
,]
, and'
. It's specifically an issue with the keyboard, as I've had it happen with the same keyboard on two different PCs.