# Actionscript 3.0 keycode numbers

**URL:** <https://forum.kirupa.com/t/actionscript-3-0-keycode-numbers/253564>\
**Category:** flash\
**Created:** [March 3, 2008, 3:05am UTC](https://forum.kirupa.com/t/actionscript-3-0-keycode-numbers/253564 "2008-03-03T03:05:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![briman](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@briman](https://forum.kirupa.com/u/briman)\
**Post date:** [March 3, 2008, 3:05am UTC](https://forum.kirupa.com/t/actionscript-3-0-keycode-numbers/253564/1 "2008-03-03T03:05:14Z")

</div>

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:
