# DELETE keycode not working

**URL:** https://forum.kirupa.com/t/delete-keycode-not-working/301804
**Category:** flash
**Created:** [December 16, 2009, 2:15am UTC](https://forum.kirupa.com/t/delete-keycode-not-working/301804 "2009-12-16T02:15:50Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ayusuits](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@ayusuits](https://forum.kirupa.com/u/ayusuits)
#### Post date: [December 16, 2009, 2:15am UTC](https://forum.kirupa.com/t/delete-keycode-not-working/301804/1 "2009-12-16T02:15:50Z")

</div>

How come this code is not working:

```php
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.
