Our professor performed a much simpler trick. An assistant was watching over us and halfway through the test the professor silently entered the room and several students flinched and looked up while the rest of us were heads down working on the exam. He then asked those students to step outside and bring all their materials. This was before smartphones, so most cheaters had crib notes.
One other form of cheating I noticed during exams was students having ear peaces to get instructions from someone outside.