# Keyboard keys

**URL:** <https://forum.kirupa.com/t/keyboard-keys/191535>\
**Category:** Uncategorized\
**Created:** [June 21, 2006, 5:32am UTC](https://forum.kirupa.com/t/keyboard-keys/191535 "2006-06-21T05:32:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dechef](https://avatars.discourse-cdn.com/v4/letter/d/c0e974/32.png) [@dechef](https://forum.kirupa.com/u/dechef)\
**Post date:** [June 21, 2006, 5:32am UTC](https://forum.kirupa.com/t/keyboard-keys/191535/1 "2006-06-21T05:32:59Z")

</div>

i want this code to move my map i.e map\_mc when the keyboard keys are pressed. when i add it to the map\_mc ,i see no effect what do u think im messing with.

```auto

on (keyPress "<Left>") {
     currentX = this._x;
     this._x = currentX - 2;
    
} 
on (keyPress "<Right>") {
     currentX = this._x;
     this._x = currentX + 2;
    
} 
on (keyPress "<Up>") {
     currentY = this._y;
     this._y = currentY - 2;
    
} 
on (keyPress "<Down>") {
     currentY = this._y;
     this._y = currentY + 2;
    
} 

```
