It's tough to keep a gun drawn on a prisoner when the cell door lock requires two hands to open - that's where the Key Gun comes in. It's literally both a key AND a gun. Our friends at Oobject have six classic examples.
16th century key gun
1850 jailers key gun
1850s key pistol
.22 calibre key pistol, 1822
19th century European lock key Caplock pistol. 9mm calibre.