I'll preface this by saying that I do like the mechanic that prevents you from standing too close to things and aiming, however, this feature should probably be more discretionary or modified so that we are able to melee with the gun in our hands. The reason I'm reporting this is because I was on my way to help @Geez test another bug I reported as private and had almost every gun available in my inventory.
Here is the scenario and why the mechanic is currently in need of some polish:
It's night time and I am being chased by infected. I only have one battery and it's in my flashlight. I run into a house and instead of waiting for the infected who chased me to leave, I decided to take the battery from my flashlight and attach it to my pistol flashlight. I turned on the pistol flashlight, opened the door and began shooting. Soon, I was overwhelmed and backed against a wall. The infected were now right on top of me, but I was unable to shoot them because at contact-distance you are no longer able to aim and shoot the pistol.
Many other times this has happened and I blamed myself, but those were all daytime situations where I was clearly being stupid. In this situation, my only source of light was on my pistol and I was unable to use it due to the involuntary state my character entered while aiming upward.