There are 3 possibilities I can think of:
1) You are accidentally hitting alt-tab, possibly with a macro system.
2) You are accidentally hitting the windows button. This can be turned off on some gaming keyboards.
3) You have an alert system from another app that is going off mid game. I have Avast anti-virus in gaming/silent mode to prevent this. Windows automatic updater will interrupt you too, make sure that is off or in silent mode.