The most likely culprit is normally a game programming bug.
But...
Since it happens to multiple games there is almost no way for that to be it.
So the next most likely is either a bug in the OS or a bug in your keyboard controller.
What OS are you running?
You should do an experiment:
0. Turn off computer
1. Unplug both keyboards.
2. Plug the keyboard you have been having the problem with into the PS/2 port.
3. Play your games and watch your bug disappear.
Give it a try and see what happens.