The fact is that it doesn´t happen always. It is working normally and suddenly it start to fail. When it happens other keys work well, but these 4 not. It's Windows 7 on a Lenovo 420 laptop, but the problematic keyboard is a IBM type M keyboard connected to a Trendnet KVM. The keyboard of the laptop is working fine.
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.