I have seen many types of weird and wacky guns, but these key guns take the cake. From at least the 17th century untill the mid 1800s, some lock makers integrated guns into lock keys for use by jailers. The idea was that if the prisoner tried any funny stuff, the jailer could fire a round through the lock at the prisoner.
Some of the key guns were very basic, requiring the jailer to use a a cigar, cigarette or match to ignite a touchhole, while others used sophisticated percussion cap and flintlock mechanisms.
My hunch is that these were marketing gimmicks from lock makers, not useful tools for prison guards and jailers. I suspect they were carried around unloaded, but cocked, so prisoners would think twice before attacking a guard.Related