I'm sure that most of you know this but just an FYI to all of you, if the truck has power locks, it should not allow the drivers door to lock while the key is in the ignition.
What happens though is most people have a few keys, a key fob, maybe some other junk hanging along with the ignition key and it will pull the key out of the ignition lock cylinder JUST enough that it won't engage the "don't lock drivers door" feature.
I always keep a spare key on my vehicles just in case the keys get locked in. It happens to even the most careful of us. It has happened to me while at work. Pull into the parking lot, turn off the vehicle. Fiddle with something in the console or glove box. Get out of truck, lock doors, shut door, go into the office. 5:00 comes around, walk out to the parking lot, go to grab for keys, go to grab for keys, grab for keys a final time, think to myself "holy crap, how did I lose my keys?" Realize I was a victim of a dumb***** attack and locked them in my truck. Without a spare on the outside of the truck, I would have had to make that embarrassing call to my wife! Saved me from ever having to bring it up. Now I can still make fun of her when she does it!
Jeff