Factories produce units in a queue. When clicking on units, they are normally added to the end of a queue. Factories can have their Repeat state set, to automatically add produced units to the end of the queue. This will cause the factory to produce the same queue endlessly.
Factories can be set to loop production with the Repeat Command. In this mode, non-looping units can be added with ALT.
Factory Production Modifiers
Left-clicking (or using the unit's hotkey) will add 1 unit to the queue, and right-clicking will remove 1 unit.
Hold SHIFT to add/remove 5 units to the queue.
Hold CTRL to add/remove 20 units to the queue.
Hold SHIFT+CTRL to add/remove 100 units to the queue.
Hold ALT to place the selected unit next in the queue. Factories in loop production mode do not repeat production of units queued with ALT.
The production queue is shown is the third row of the factory Units tab. Each item in the queue is a block of units of the same type.
Blocks can be modified by clicking on them, with the above modifiers, to adjust the number of units in the block.
Blocks can be left clicked and dragged to change their position in the queue.
ALT-click a block to move it to the front of the queue. This will waste any metal/energy used on whatever was being produced prior to the click.