Keys are items used to activate locked doors or switches.
There are two types of key: electronic keycards (usually used for UAC bases) and skull keys (usually used for demonic locations). Attempting to open a locked door without possessing the key of the required color will result in the door not opening, a linedef sound, and a message saying "You need a [color] key to open This Door." Once obtained, all doors with that color can be open until the level is reset. All keys are lost upon exiting a map. In deathmatch mode, all keys are removed and you start off with all three keycards and three skull keys.
Multiple keys of the same color can be picked up in the same level, the status bar will display whichever last one was picked up, the *idkfa* cheat code (select text between asterisks to reveal) will display skull keys on top of keycards. Mostly, bars are used for keycard pickups and vertically-arranged skulls are used for skull key pickups. However, this is violated at least once.
- Locked switches were introduced in E4M2: Perfect Hatred where you need the correct key to activate the switch. However it was limited only to doors, so that a switch that remotely opens a door can be locked, but not for wall rising/lowering (or anything like that).
- Some levels have doors that you need multiple keys to open, by placing several locked doors in front of each other, first mentioned in E2M6: Halls of the Damned.