You see this convention a lot in video games and movies like Indiana Jones. Does it have any basis in fact, or is it just writers inserting modern conveniences into ancient settings?
Here's a discussion from 3 years ago:
Is there any historical precedent for a pre-modern culture constructing elaborate mechanical traps (as seen in many films such as "Goonies" or in various "Indiana Jones" films) that are disarmable by an artifact or by a sequence of actions? Where does this common film trope come from?
There are a couple similar topics from the FAQ section on Monuments and Architecture.