The lock is set from inside the door.
Turn the lock door.
Once the hanger is in position hold it with one hand and grab the doorknob with other applying some turning force in the direction the knob would turn if it were unlocked.
However if you insert the key and the entire lock cylinder turns it is a sign that you have a bigger door lock problem at hand that needs to be addressed.
If you turn the key far enough the door should lock.
Try to turn the doorknob and push the door open.
That can cause the pins to get stuck in a partially raised position and prevent the plug from turning.
Tap the end of a chisel under the door stop on the striker side of the jamb.
Pull the key out of the keyhole.
Out of all the door lock problems that have been discussed this is probably.
You can spray a little dry lubricant in the lock to free up the plug.
The doorknob on the interior side would turn and open the door whether the knob was locked or unlocked.
To remove the key turn it counter clockwise back to the position at which you slid it in but no further.
Outdoor locks can collect a lot of dirt and dust inside the lock cylinder.
Twisting the portruding tab on the knob will lock the door.
When installing a door lock the keyhole should be positioned on the outside of the door so you can unlock the door with a key from the outside.
Pull the hanger toward.
Spray the lock with lubricant to remove dirt and dust.
Shut the door and try to lock it.
If that is the problem it is easy to fix.
Pry up on it until it comes loose and remove it.
Doors with a twisted tab lock are still easy to get past even if that tab is set to lock these locks appear on the handle of a door when either facing laterally or vertically the door will be locked or unlocked.
If it won t lock open the door.
My family has always had the sort of knobs that won t turn at all when the door is locked and has grown accustomed to interpreting a turning doorknob as one that will not lock behind them.