As Slobo says, and as I mentioned, it's not quite that simple and there are provisions, but in a number of jurisdictions the case law shows that it's not that hard to show you were assaulted (note that doesn't necessarily mean you were hit) and therefore within your rights to use deadly force - end of story.
As I said, even if you have a key or a right of entry, entering without checking or knocking etc. is stupid, regardless of the potential for someone inside to be armed.