Done that too, got scaried to die there!
I am an industrial electronic tech.
So all work on my new lathe projecs was stopped immediately to solve this very important safety problem and there is an easy fix for it.
Here goes....
Most machines have an emergency switch or ES "loop" that consist of a circuit comprising the 'mushroom' some limit switches and whatever should prevent or stop the machine if anything is wrong. It is a simple manner to make a chuck key holder where a microswitch will be activated when the key is in the holder. This way, no key? no run!
The idea is just open this loop and add one or two more microswitches in the circuit.
I made mine from wood. The keychuck is inserted in a hole and close the contact when in. I made it to hold both the 3 jaws and the 4 jaws chucks since they are a bit different.
If any of the keys is missing, the lathe will not start, simple, efficient, safe!
I also made a pair of microswitch holders that I can set anywhere on the V-way of the lathe so that when the carriage hits either one (going L to R or R to L) the machine will stop. Guess how I came with this one!
I had once the tool post hit the chuck, this broke the alorris type tool holder.
I also had the carriage bang in the tailstock, this case it broke the shear pins on the drive shaft!
Newbee errors, but dangerous newbee errors!
When I told about tis to my boss at work, he found this quite clever and commissioned me to go around all our machines in the workshop, but also on the production floor to see how I could make the machines safer, more idiot proof.
It took me almost a year to go about the whole plant!
Luc