I remember years ago reading an article about a German inventor who built a rat trap that used a photocell and light beam and a solenoid. When the rat entered the passage way and interrupted the light beam, the photocell would activate a solenoid plunger that would pop the rat in the head, thus killing it. He had the contraption elevated off the ground, so when the rat got killed, it would drop back down to the floor allowing other rats to experience the same treatment. I forget what he was using for bait, but he commented that the rats would climb over the dead carcasses to gain access to the trap.
I often thought about building a similar setup for mice.