Controlling scenes with keyboard keys

Does anyone know a good way to be able to go back and forth between scenes by using keyboard keys (for instance, the left and right arrows)? Or perhaps point me in the right direction?

Thanks!


function onKeyDown () {
	if (Key.isDown (Key.LEFT)) {
		prevScene ();
	} else if (Key.isDown (Key.RIGHT)) {
		nextScene ();
	};
};

Key.addListener (this);

A-ha! I was so close! Thanks so much!