Although you can use the keyboard to whack the elves, this project is intended to be used with a Makey Makey, a "hammer," and contact pads.
Keyboard: Use the Left, Down, and Right arrow keys to hit the left, middle, and right elves, respectively.
Makey Makey: Connect your hammer to "Earth" on the Makey, and then connect your contact pads to the "Arrows" contacts on the Makey. Plug your Makey into the USB port on your computer, and you're ready to play.
8-bit Jingle Bells courtesy of Zed ProMedia on YouTube.
Complete build details can be found in the Instructable here: http://www.instructables.com/id/Build-a-Holiday-Whack-a-Mole-Game-With-Scratch-and
Rationale for creating the game can be found here: http://www.shaun-taylor.com/christmas-games-with-scratch-and-a-makey-makey/