Switch

Switches are implemented using wall texture names that are built-in to the Doom rendering engine. At initialization time, the engine finds each texture name listed in the “Off” column below (in the TEXTURE1 or TEXTURE2 lump), and links it with the name in the “On” column. When a linedef using a switch texture has a type that can be activated, the texture is replaced by its counterpart when used. If the line effect can be repeated, the switch keeps its alternate texture for a full second, before reverting to its initial appearance; internally, repeatable switches are referred to as buttons. Switches play the sound when activated, and  when resetting. Exit switches play.

Switches can be activated by pressing USE key in range less than 48 map units, the same as doors.

Switches in Doom follow the convention of having a name prefixed by SW1 (for the “Off” version) and SW2 (for the “On” version). However, this is purely a convention; the engine works with a hardcoded list of names, and a pair of custom textures named, for example, SW1DUMMY and SW2DUMMY will not be considered as a switch.

Switches follow a tiered system: all switches present in the shareware version of Doom are expected to be found in the full version; and all switches present in the registered version are expected to also be found in Doom II. However, since a few Doom switches were not used in the Doom II levels, they were replaced by dummies, despite the needed patches for their definition being actually present in DOOM2.WAD.

Animated switches are possible, if a switch texture (on, off, or both) is included in an animation range. This effect is notably used in Final Doom, where to achieve it the textures have not been sorted alphabetically.

Doom switches
The following codes are used in the “Version” column above:
 * S - Shareware
 * R - Registered/Ultimate Doom
 * C - Commercial &mdash; Doom II

Other games
Heretic has only two types of switches, a "normal" one (/) and an "exit" one (/), with only one switch sound, called. Although the switch textures are 64x128, they are usually used at a much smaller scale, indented in a little alcove, allowing to compensate for the lack of variety. The normal switch button shows a blueish-gray trident symbol, with the teeth pointing up and converging; while the exit switch shows a deep blue trident symbol, with the teeth pointing down and parallel.

Hexen offers more variety, with four different switch sounds depending on the switch texture. serves as a generic switch sound, serves as the sound for a chain being pulled,  for a rope being pulled, and  for a valve handle being rotated. Finally, certain textures meant to be used with puzzle items have their own switch sound defined,. The switch animations are also improved, switch textures having not just an on and an off state, but also some intermediary steps. As an evolution of Heretic's design of placing switches in small alcoves, most of Hexen's switches are small textures, 32 in width and 32, 40, or 48 in height.

Source

 * Unofficial Doom Specs