To prevent this from happening in the first place, I (as a professional locksmith) recommend that the key-in-knob hardware be replaced with a passage function knobset (no lock, no button) and that a deadbolt be installed above the knob. This way the knobset keeps the door closed when unlocked, and you can't accidentally lock yourself out, as you need the key in your hand to lock the deadbolt.
As an alternative, a push button combination lock could also be used.
If you do hide a key, hide it around the corner of the house. Do not hide it with easy access to the locked door.
|