# KeyboardEvent.KEY\_DOWN. Some keys work, others dont

**URL:** https://forum.kirupa.com/t/keyboardevent-key-down-some-keys-work-others-dont/286129
**Category:** flash
**Created:** [April 10, 2009, 2:40pm UTC](https://forum.kirupa.com/t/keyboardevent-key-down-some-keys-work-others-dont/286129 "2009-04-10T14:40:38Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ryrocks](https://avatars.discourse-cdn.com/v4/letter/r/ba9def/32.png) [@ryrocks](https://forum.kirupa.com/u/ryrocks)
#### Post date: [April 10, 2009, 2:40pm UTC](https://forum.kirupa.com/t/keyboardevent-key-down-some-keys-work-others-dont/286129/1 "2009-04-10T14:40:38Z")

</div>

I want to run a function when the enter key is pressed.  
I believe the following code is correct:

```auto

stage.addEventListener(KeyboardEvent.KEY_DOWN, selectDetect);

public function selectDetect(event:KeyboardEvent):void 
	{
		if (event.keyCode == Keyboard.ENTER) 
                {
                 ..........
                 .....
                 ..
                }

	 }

```

However, nothing happens! If I change the code to Keyboard.SPACE it runs when the space bar is pressed. It seems strange to me. Any one else come across this?
