The flies you describe I would suggest are Simulium flies, more commonly known as blackflies. No more than a couple of millimetres long these flies are host specific and often swarm around you when you are outdoors. They do not bite necessarily, unless of course you happen to be a suitable host. I get them in my garden at certain times of the year and just a few days ago I found a walk alongside a woodland stream somewhat spoiled because of the attention from these flies, again not biting but crawling over my head and face. I guess that they consider an enclosed dark space to be a trap so their attentions are easily avoided by going indoors or getting into a vehicle; nothing to do with being hot and sweaty. Many insects when trapped in a room fly to the window when it is brighter outside. They 'know' that they can escape from a confined space by moving to the light, so to do the opposite means being trapped.
One serious disease, river blindness, mainly restricted to sub-saharan Africa is transmitted by one of these flies.
Mosquitos, on the other hand, will follow a person indoors. For them if anything the reverse is true; they shun the light. When I run light traps near mosquito ridden swamps, I'm bitten to death as night approaches, but no sooner has darkness fallen they stay away from the bright light; the females that is. On hot nights with the bedroom window open I find leaving the light on certainly helps to keep them away as well.