# Keyboard.DELETE Problem in as3

**URL:** <https://forum.kirupa.com/t/keyboard-delete-problem-in-as3/288394>\
**Category:** flash\
**Created:** [May 15, 2009, 6:42am UTC](https://forum.kirupa.com/t/keyboard-delete-problem-in-as3/288394 "2009-05-15T06:42:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![probphp](https://avatars.discourse-cdn.com/v4/letter/p/e99b99/32.png) [@probphp](https://forum.kirupa.com/u/probphp)\
**Post date:** [May 15, 2009, 6:42am UTC](https://forum.kirupa.com/t/keyboard-delete-problem-in-as3/288394/1 "2009-05-15T06:42:21Z")

</div>

Hello all,

stage.addEventListener(KeyboardEvent.KEY\_DOWN, KeyPressed);

public function KeyPressed(e:KeyboardEvent):void {  
var keyPressed = e.keyCode;  
if(keyPressed == Keyboard.DELETE)  
{  
trace(“delete key has been pressed”);  
}  
if(keyPressed == Keyboard.LEFT)  
{  
trace(“Left key has been pressed”);  
}  
}

I have done the above code in Adobe Flash CS4 Professional with AS3

This is working fine for LEFT key pressed  
BUT BUT BUT does not working it when pressed the DELETE key.

I am astonished to see this.

What is the problem with this code.  
Or is there any thing else to do work with DELETE key pressed .

Please help me with the source.

Thanks in advance.
