
The lock of a firearm is a mechanism used to initiate firing. It is generally used as a historical term, referring to the mechanisms used in muzzle-loading and early breech-loading firearms, as modern firearms uniformly fire by use of a firing pin to strike the rear of a cartridge. Side-lock refers to the type of construction in which the individual components of the mechanism are mounted on either side of a single plate. The assembly is then mounted to the stock on the side of the firearm. In modern firearm designs, the mechanism that initiates firing is generally built into the frame or receiver of the firearm and is referred to as the firing or trigger mechanism.
The hand cannon, which was the first true firearm, had arrived in Europe by c. 1338. These cannons were muzzle loaded. The propellant charge was lit through a touch hole; a small priming charge over the touch hole was ignited with a lit piece of slow match or similar.
Hand cannons were ungainly; the difficulty being in holding and aiming the weapon while manipulating the slow-burning fuse needed to fire it. Improvements to the design placed the touch hole and a priming pan to the side of the barrel. A cover to the priming pan allowed this to be filled with priming powder in advance of firing, but there was no actual mechanism for firing.
A firelock is a firearm in which sparks ignite the priming. More specifically, it refers to the mechanism or lock of such firearms, though it may also refer to a gun's lock that use a slow match to ignite the powder charge.
The matchlock was a lever mechanism that simplified the process of firing. A slow match would be held clear of the flash pan in a spring-loaded pivoting arm (the serpentine); depressing the firing lever would dip the burning match into the flash pan. The snap matchlock latched the serpentine back against spring tension, actuating the trigger or firing lever would release the serpentine, allowing it to rotate and dip the lit match into the priming pan. This reduced hesitancy at the moment of firing, thereby improving accuracy. However, the match could be snuffed out when it struck the flash pan.
The next advance was a self-igniting firearm that did not require a lit slow match to fire, with the first of this type being the wheellock. The wheellock holds pyrite against a rotating steel wheel, which produces a spark directed at the priming charge in the flash pan. The wheel is rotated by a spring under tension, which needed to be wound up like a clock before each firing, held by a latch, and fired by a lever that released said latch. To avoid stalling, the pyrite would be lowered onto the rotating wheel rather than held against it permanently. The mechanism would also remove a cover from the flash pan at the moment of firing, sliding it forward. The cover would retain the priming charge in the flash pan during transit. It was altogether quite complicated and expensive, and as a result found limited use.

The next step in firearms design was the snaplock, which used flint striking steel to generate the spark. The flint was held in a rotating, spring-loaded arm called the cock. This was held cocked by a latch and released by a lever or trigger. The steel is curved and hinged, which accommodated the flint's arc, maintaining contact with the steel. The spark produced is directed downward into the flash pan. The snaphance incorporates a mechanism to slide the pan cover forward at the moment of firing.
The doglock incorporated a second latch (or dog) as a safety mechanism that engaged the cock in a halfway position, or half-cock. The dog was independent of the trigger, and is released when the lock is fully-cocked. The miquelet lock was the penultimate flint-sparking lock. It had an L-shaped frizzen, the base of which covers the flash pan and is hinged forward of the pan. The flint strikes against the upright of the "L" and flips the frizzen forward, revealing the pan to the sparks created. Additionally, the miquelet lock has a half-cock mechanism similar in function but differing in operation from the doglock.
The flintlock, sometimes referred to as the true flintlock to distinguish it from other flint-sparking mechanisms, and also known as the French lock. It uses a frizzen similar to the miquelet lock and has a half-cock position. The distinction between the two locks is that the flintlock uses a single vertical sear to latch the cock in both the cocked and half-cocked positions. The sear is a lever that pivots in the vertical plane perpendicular to the axis of rotation of the cock and acts much like a pawl engaging the catch points of a ratchet gear. The tumbler is similar in function to a ratchet gear, and is mounted on the inside of the lock-plate and has two catch-points corresponding to the half-cocked and full-cocked positions. The half-cock catch-point is a V-notch into which the sear fits and cannot be levered away by the trigger to disengage the tumbler.
Firelock firing mechanisms are assembled on either side of a mounting plate, and is then mounted to the side of the stock of the firearm. The actual trigger may be separately mounted from the lock-plate. Side lock refers to lock mechanisms of this general construction, and continued to be used in percussion-lock firearms and early firearm designs using metallic cartridges.
The advent of the percussive ignition eliminated the need for a spark to discharge a firearm. Instead, the discharge is initiated by striking a shock-sensitive explosive material. Initial patents are attributed to the Reverend Alexander John Forsyth, who used a fulminate powder delivered from a charger that was integral to the lock mechanism. The charger contained a firing pin that was struck and, in turn, struck the fulminate. The mechanism was otherwise constructed similarly to the flintlock's. The fulminate used in percussive locks was variously packaged as pills, metal tubes, and paper patches, but the percussion cap soon predominated.
The flintlock mechanism was readily adapted to utilize this new technology. The flash pan was removed, with a nipple (a small hollow cone) being fitted to the touchhole, and the percussion cap was fitted over the end of the nipple. The cock was modified to strike the cap and redesignated as the hammer, As a safety measure, the hammer's face was soon hollowed to enclose the cap. As an economic measure, many existing flintlocks (particularly military stocks) were converted to use percussion caps; Most conversions modified rather than replaced the firearm's lock mechanism while lock designs in new models of longarms were largely unchanged. Some designs emerged, such as the Maynard carbine and the pellet feed system employed by the Sharps carbine, which mechanised the recharging of the primer, but such systems were never widely adopted.
Percussion lock refers generally to firearms that use external percussive primers. Cap lock and tube lock refer to percussion-lock firearms that utilize either cap or tube primers, respectively. Scent-bottle lock refers to a design by Forsyth. The charger containing the fulminating powder resembles a scent bottle.
Early breech-loading cap lock longarms, such as the Sharps carbine and the Wilson carbine used same side-mounted lock mechanism as muzzle-loading percussion locks.
The commercially practical revolver followed the advent of the percussion cap. The action of cocking the hammer is used to rotate the cylinder and bring a loaded chamber in-line with the barrel, preparatory to firing. The mechanism for cocking, rotating, and firing revolvers is contained between the side-plates that form the frame of the revolver. This was a significant departure from earlier lock mechanisms that were constructed about a single plate fixed to one side of a firearm.
Metallic cartridges packaged projectile, propellant, and primer together. They are initiated by striking with a firing pin or striker that passes through the breechblock. Early metallic-cartridge, single-shot breechloading rifles, such as the British Snider–Enfield model 1866 and the American Springfield model 1873, continued to use side-mounted hammers and lock mechanisms that differed little from the cap lock and the flintlock in manufacture. The firing pin is angled away from the axis of the barrel and toward the hammer to accommodate the offset of the hammer. Further developments of breech-loading mechanisms and repeating firearms placed the components of the mechanism inside the receiver or frame of the firearm. This can be seen in the Martini–Henry, the Remington-Lee Model 1879, and the Winchester rifles. The mechanism employed to open and close the breech is integrated with the firing mechanism to cock the firearm. Improvements in spring technology have also led to cheaper helical coil springs replacing leaf and V springs. The term lock is not generally used to refer to the firing or trigger mechanism of metallic cartridge firearms.
Side-by-side shotguns and hunting rifles continued to use side-locks until the advent of the boxlock patented by Anson and Deeley in 1875. Side-lock shotguns have two separate lock plates mounted on the sides of the butt of the gun, not on the receiver. In the boxlock, the firing mechanism components are contained within the gun's frame. This simplified manufacturing and significantly reduced costs. While the boxlock is referred to as a hammerless gun, the mechanism's hammers are concealed within the gun's frame. Side-lock shotguns continue to be made for the high-end market.
Lock, stock, and barrel is a figure of speech referring to the totality of a firearm as: the barrel through which the bullet is directed toward a target, the stock which provides a means of gripping the firearm, and the lock as the firing mechanism.[citation needed]