Escape key shouldn't open the gamemenu if chat is open or a predroped building (ghostbuilding) exists as commander.