# More than one keypress

**URL:** <https://forum.kirupa.com/t/more-than-one-keypress/218219>\
**Category:** Uncategorized\
**Created:** [March 5, 2007, 11:06pm UTC](https://forum.kirupa.com/t/more-than-one-keypress/218219 "2007-03-05T23:06:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chaztheman](https://avatars.discourse-cdn.com/v4/letter/c/eb9ed0/32.png) [@chaztheman](https://forum.kirupa.com/u/chaztheman)\
**Post date:** [March 5, 2007, 11:06pm UTC](https://forum.kirupa.com/t/more-than-one-keypress/218219/1 "2007-03-05T23:06:22Z")

</div>

Hi

When i run this code - flash can only initiate one of the keypresses in the list and cannot ‘multitask’! Do i need to use the mutiple key detection code or is there a simpler way of doing it??? Thanks!!

```auto
 
 
[COLOR=darkgreen][COLOR=blue]on (keyPress "<Left>") {[/COLOR]
 
 _rotation -= 5
 
}
[COLOR=blue]on (keyPress "<right>") {[/COLOR]
 
 _rotation += 5
 
 }[/COLOR]
[COLOR=darkgreen][COLOR=blue]on (keyPress "<Up>") {[/COLOR]
 FwdSpd = 4
 
var deg =(this._rotation*(math.PI/180))
this._x = this._x + FwdSpd*math.sin(deg)
this._y = this._y - FwdSpd*math.cos(deg)
}[/COLOR]
 
[COLOR=blue]on (keyPress "<Down>") {[/COLOR]
 
[COLOR=darkgreen]FwdSpd = 4[/COLOR]
 
[COLOR=darkgreen]var deg =(this._rotation*(math.PI/180))[/COLOR]
[COLOR=darkgreen]this._x = this._x - FwdSpd*math.sin(deg)[/COLOR]
[COLOR=darkgreen]this._y = this._y + FwdSpd*math.cos(deg)[/COLOR]
[COLOR=darkgreen]}[/COLOR]
 

```
