Most correctional officers today do not carry firearms, unless they're isolated away from the prison population. But back in the olden days, prison guards on their rounds needed a little backup power in their hands, especially when opening cell doors—usually a two-handed job.
So came the birth of jailer key guns, a cell door key that doubles as a primitive one-shooter. Filled with gunpowder, "turnkeys" could fire the miniature key-pistol in case there was any trouble with the prisoner when opening the door.
They may not have been too effective, especially with only one shot, but it was definitely enough to thwart the mischievous plans of potentially dangerous prisoners. On this page are six examples of jailer key guns from Oobject, dating back to the 17th century.
Making one of your own turnkey guns could prove difficult if you're not an experience gunsmith, as well as any functional miniature gun, but there are plenty of other things you can try out—which are much more harmless (and legal)—like blow dart shooters, tiny potato cannons, and even little Lego launchers.