Changing quit experiment key press from escape

We’ve tried this solution with no luck. If I understand correctly, this snippet should be put in every routine in code components on the “each frame” tab.

I have tried multiple combination of keys, and the experiment quits when I input any three keys (regardless of timing). For example, if I press spacebar to advance past the two routines, then after the third spacebar, the experiment will quit.

I’ve tried naming all the “keys” objects differently. I’ve also tried just putting this code in one routine. Then, the experiment doesn’t close like above, but I also can’t close the experiment unless I’m in that one routine.

Any ideas?