# Why is "Key.isDown()" not working?

**URL:** <https://forum.kirupa.com/t/why-is-key-isdown-not-working/169330>\
**Category:** Uncategorized\
**Created:** [November 15, 2005, 2:13pm UTC](https://forum.kirupa.com/t/why-is-key-isdown-not-working/169330 "2005-11-15T14:13:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fr\_ode](https://avatars.discourse-cdn.com/v4/letter/f/9d8465/32.png) [@fr\_ode](https://forum.kirupa.com/u/fr_ode)\
**Post date:** [November 15, 2005, 2:13pm UTC](https://forum.kirupa.com/t/why-is-key-isdown-not-working/169330/1 "2005-11-15T14:13:58Z")

</div>

Hi! I’m building up an image resize gallery (thank you scotty!), and I want to navigate using the left and right arrow keys on my keyboard.

I’ve been trying to figure this out a while now, but I can’t get it working. Can anybody help me out?

Here’s my code:

```auto

myIdentifier = Math.round(Math.random()*10000);
gallery_xml.load("gallery.xml?uniq="+myIdentifier, 1);
Key.isDown(LEFT); {
cur--;
if (cur<0) {
containerMC.loadPic(pArray.length-1);
} else {
containerMC.loadPic(cur);
}
};
Key.isDown(RIGHT); {
cur++;
if (cur>pArray.length-1) {
containerMC.loadPic(0);
} else {
containerMC.loadPic(cur);
}
};

```
