Do you have any game pad or game controller? I've seen some cases where a game pad was still being registered as present after it was removed. For some reason that generated garbage input which is caught up by DirectInput and thus by the games. Simply plugging the controller in again or disabling the phantom HID controller usually appear to work. (Be careful about disabling devices, you can mess up your Windows installation in the worst case)
I once made a patch which "fixes" the solution by ignoring game pad input. I don't remember for which game though.
I sadly haven't been able to figure out a good way to fix this. I am open to ideas

Lemme know if you figure out a more persistant solution.