Two different problems.
Being able to take the keys out while it is in run, just means that the lock cylinder is worn internally.
Electrically, the truck could care less if the keys are in it or not.
Several years ago, I pulled the cylinder out of my steering column and dumped all the tumblers out.
Now, you can crank it with no key at all. In fact, the only time I use my key is to lock the doors.
BUT, if you turn the key to off, and the truck keeps running, that is a problem.
Most likely the ignition switch has problems.
If so, then it can cause all kinds of things. Especally if it is coming apart internally.
You may need to replace it. Someone here can probably tell you how many years they were the same, so you can try to find one in a junkyard.
Of course, I am quite sure that several folks here have done away with them entirely.
Just replaced it with a set of toggle switches.