
A wheellock rifle.

A diagram showing a wheellock while being fired. The pyrite is referred to here as a "flint," a fairly common error in flintlock-era descriptions of wheellocks.
The wheellock mechanism, or just wheellock, was an earlier style of gun lock that preceded the flintlock, and succeeded the matchlock, making it the second gun lock to be used in an arquebus, musket or pistol.
History[]

A modern reproduction wheellock mechanism based on Da Vinci's original sketch (top)

Löffelholz's wheellock tinder-lighter, c.1505
The wheellock was developed in Europe in the late 15th or early 16th century; by exactly whom is not known. Leonardo da Vinci produced an early sketch of a wheellock mechanism mounted on a rifle as part of a series of military designs commissioned for the Duke of Milan, from around 1482 to 1499, although some calligraphy experts have dated the sketches to around 1500 to 1508. Da Vinci's wheellock sketch is contained within the Codex Atlanticus. Another early depiction of the wheellock was drawn by Martin Löffelholz of Nuremberg in 1505. Löffelholz's drawings show the mechanism being used for a tinder-lighter rather than a rifle. A German gunsmith named Johann Kiefuss was often credited with inventing the wheellock in 1517, although there is little evidence of this and it is believed to have originated from legend.

A pair of early wheellock muskets, dated to 1530 and 1533.
Several early written records of the wheellock come from Germany and Italy. In 1507, an Italian Cardinal, Ippolito d'Este I, ordered a "gun of a type that is kindled by stone", and in 1515, there is written mention in Cronica Newer Geschicten of an incident in Augsburg in which a young man accidentally shot a prostitute with a type of "self-igniting gun". In 1517, Emperor Maximilian I issued a decree outlawing the civilian use of such guns within the Holy Roman Empire. Some of the earliest surviving physical examples of rifles using the wheellock mechanism were made in Italy, probably around the early 1520s; these guns include built-in crossbows. A German wheellock musket made in 1530 is the earliest known example with an inscribed date. This gun was made by Bartholme Marquart for Emperor Charles V.
It was a complicated mechanism, requiring careful maintenance and only able to be manufactured by a handful of gunmakers, while any locksmith could build a matchlock action. As a result, wheellocks could only be afforded by nobility, officers, and rich merchants, though some military units with noble sponsors could afford to equip all of their troops with them. It was commonly used on weapons designed for personal defense, as the wheellock, having no burning match, was the first type of firearm which could be holstered in a ready-to-fire condition.
Eventually, many improvements were made upon it including a cover over the flash pan, allowing the weapon to be carried primed as well as loaded, plus a safety catch. Later examples used spiral torsion springs (the type used in clockwork mechanisms) for improved reliability.
Due to the expense of wheellock weapons, the matchlock remained the standard type of gun lockwork until the invention of the flintlock. Wheelocks continued to be produced even into the days of caplocks, finally falling out of favour as breech-loading actions such as break-open and bolt action came into widespread use.
Design details[]
The heart of a wheellock mechanism is the wheel that gives the action its name. This is a rotating metal disc with a rough surface, spring-tensioned by hand using a winding key or spanner on a projecting rod, usually square in cross-section, prior to using the weapon. Pulling the trigger releases the sear and allows the wheel to rotate.
The second operating element is an arm on top of the action containing a pair of jaws which grip a piece of iron pyrite. This resembles the cock of a flintlock, but is actually referred to as a "dog" as it is a part which impedes ("dogs") the motion of another part. Usually it pivots forward to a "safe" position and backward to engage the pyrite with the top of the wheel. When the trigger is pulled, the wheel grinding against the pyrite generates sparks: the grinding point is inside the weapon's flash pan, and so ignition is instantaneous. In later examples a moving flash pan cover was added, with the trigger opening the cover and allowing the dog to contact the wheel. The mechanism as a whole works similarly to a modern toy spark gun or a cigarette lighter's wheel.
The choice of pyrite rather than flint was for durability: flint is far superior for generating sparks, but also far harder and would quickly grind the rough surface texture off the wheel, requiring expensive repairs.
Because it did not depend on a burning match to operate, the wheellock had many advantages over the matchlock: it was much less sensitive to rain or wind, would not give away the shooter's position with the glow of a lit match at night, and could easily be holstered or concealed. It was also less dangerous to handle as it did not require placing black powder in close proximity to a burning match.
Components[]
Wheel[]

The wheel and other parts within the wheellock's lock plate.
The wheel in the wheellock mechanism is the centerpoint of the wheellock, which ground against the pyrite held by the dog while it was spinning (after being wound up), which made sparks that were led into the flash pan.
It was one of the most tedious parts in the wheellock mechanism since, every so often the springs (the older types) that were connected to the wheel inside the lock would have to be adjusted. While the wheellock was being loaded, the wheel would be wound-up by the wielder with a special key, so it would spin upon pulling the trigger. It was later improved upon by putting in more durable springs.
Dog[]

The wheellock's dog (right).
The dog in the wheellock mechanism is what held the pyrite against the wheel. Before the wheellock was fired, the dog had to be prepared, by (if necessary) replacing the pyrite; then the dog was pushed down into contact with the wheel. The forward position was usually simply a "safe" position to place the dog in so the weapon could not be fired accidentally.
Priming pan[]
Main article: flash pan
The flash pan is what held the powder which was what ignited the main powder in the barrel, after it was exposed to sparks; the sparks were made by the dog containing pyrite contacting the spinning wheel.
Wheel key[]

A sketch-style diagram showing the wheel key (right).
The key is what was used to wind the wheel up before firing, they would have to be pressed onto the wheel (where a small screw-like piece was which the key "hooked" to) and wound.