Actionscript 3.0 keycode numbers

I am attempting to use actionscript 3.o, I want to press a button and then make a function occur.

I have been doing this-
function enterHandler(event :KeyboardEvent):void
{
if (event.keyCode == Keyboard.ENTER)
{
onClick();
}
}

but this only seems to work with function keys like SHIFT and ALT

I’d like to use the ASCII code so that I can use any key on the keyboard

Can someone help me with the proper syntax? :hangover: