You mean like an ALT-TAB command.
I would try run with a minimum amount of background processes before I even consider a hardware relevans.
If any at all, only a keyboard or mouse problem springs to mind.
I haven't heard of a driver problem ever of that nature.
Disconnet internet/Stop mail-client,ftp,bittorent whatever.
Close down av,firewall everything you don't need.
Trial-by-error.
Maybe a sevice could cause this kind of erratic behaviour?
Just my cents.

edit
Run a virus/spyware scan