# No key is pressed?

**URL:** <https://forum.kirupa.com/t/no-key-is-pressed/69169>\
**Category:** Uncategorized\
**Created:** [November 2, 2004, 1:45am UTC](https://forum.kirupa.com/t/no-key-is-pressed/69169 "2004-11-02T01:45:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rmthegreat88](https://avatars.discourse-cdn.com/v4/letter/r/6bbea6/32.png) [@rmthegreat88](https://forum.kirupa.com/u/rmthegreat88)\
**Post date:** [November 2, 2004, 1:45am UTC](https://forum.kirupa.com/t/no-key-is-pressed/69169/1 "2004-11-02T01:45:23Z")

</div>

how do i tell flash to go to a certian state when neither of 2 keys is pressed?

see, i have this game and i need the charachter to go into a state of idleness when no key is being pressed. i also belive that this could be done with speed but i am a newbie.

here is the code.

```php
onClipEvent (load) {
fall = false;
_name = "circle";
jump = 0;
speed = 6;
jumpheight = 12;
maxfall = -54;
}
onClipEvent (enterFrame) {
xmin = getBounds(_root).xMin;
xmax = getBounds(_root).xMax;
ymin = getBounds(_root).yMin;
ymax = getBounds(_root).yMax;
if (Key.isDown(Key.SPACE) && fall == false && jump == undefined) {
fall = true;
jump = jumpheight;
gotoAndStop("jump")
}
if (jump<>undefined) {
if (jump>maxfall) {
jump--;
}
_y -= jump;
}
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
_x -= speed;
gotoAndStop("left")
}
if (Key.isDown(Key.RIGHT)) {
_x += speed;
gotoAndStop("right")
}
}

```

if you need more information just ask
