DELETE keycode not working

How come this code is not working:

voca = new Object();
voca.onKeyDown = function() {
	if (Key.getCode() == 46)  { 
	voca_pg2.text = "1"
	}
}
Key.addListener(voca);

Means that when I press the delete button, the textbox will show 1.
If I change the keycode 46 to 113, for example (that’s F2), it is working.