# Simultaneous keys press at the same time?

**URL:** <https://discourse.processing.org/t/simultaneous-keys-press-at-the-same-time/4105>\
**Category:** Coding Questions\
**Created:** [October 4, 2018, 2:22am UTC](https://discourse.processing.org/t/simultaneous-keys-press-at-the-same-time/4105 "2018-10-04T02:22:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![zng](https://avatars.discourse-cdn.com/v4/letter/z/7c8e57/32.png) [@zng](https://discourse.processing.org/u/zng)\
**Post date:** [October 4, 2018, 2:22am UTC](https://discourse.processing.org/t/simultaneous-keys-press-at-the-same-time/4105/1 "2018-10-04T02:22:34Z")

</div>

Hi, I am actually pretty new to the concept of programming so forgive me if I sound kinda dumb.

I am trying to make a game using p5 and the p5 dom where there is 6 image randomiser(think slot machine) and each image is associated with a key each. The image will only stop moving if the keys are held down. Right now I am unable to hold more than 2 keys at the same time, if I hold 3, the 3rd key wont stop the randomiser and sometimes even force release my other keys.

Is this a JS limitation or I am just missing something?

---

<div class="post-metadata">

**Author:** ![tony](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tony/32/949_2.png) [@tony](https://discourse.processing.org/u/tony)\
**Post date:** [October 4, 2018, 2:25am UTC](https://discourse.processing.org/t/simultaneous-keys-press-at-the-same-time/4105/2 "2018-10-04T02:25:02Z")

</div>

Can I ask you to provide your code? (Formatted)

---

<div class="post-metadata">

**Author:** ![zng](https://avatars.discourse-cdn.com/v4/letter/z/7c8e57/32.png) [@zng](https://discourse.processing.org/u/zng)\
**Post date:** [October 4, 2018, 2:27am UTC](https://discourse.processing.org/t/simultaneous-keys-press-at-the-same-time/4105/3 "2018-10-04T02:27:00Z")

</div>

is there anywhere i can upload the code? JSfiddle does not seems to have the p5.dom.js inside

---

<div class="post-metadata">

**Author:** ![tony](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tony/32/949_2.png) [@tony](https://discourse.processing.org/u/tony)\
**Post date:** [October 4, 2018, 2:29am UTC](https://discourse.processing.org/t/simultaneous-keys-press-at-the-same-time/4105/4 "2018-10-04T02:29:26Z")

</div>

If possible, isolate the bug to a smaller block of code, and then just post it straight onto here as text. (And then formatted with the `</>` button

---

<div class="post-metadata">

**Author:** ![zng](https://avatars.discourse-cdn.com/v4/letter/z/7c8e57/32.png) [@zng](https://discourse.processing.org/u/zng)\
**Post date:** [October 4, 2018, 2:34am UTC](https://discourse.processing.org/t/simultaneous-keys-press-at-the-same-time/4105/5 "2018-10-04T02:34:08Z")

</div>

I have no idea where the bug is… and it is a website so it consist of html, css, and js(p5) files.

---

<div class="post-metadata">

**Author:** ![tony](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tony/32/949_2.png) [@tony](https://discourse.processing.org/u/tony)\
**Post date:** [October 4, 2018, 2:42am UTC](https://discourse.processing.org/t/simultaneous-keys-press-at-the-same-time/4105/6 "2018-10-04T02:42:03Z")

</div>

It will take time, but debugging code is a very important skill to learn as a programmer - in fact, the general rule is that your code should take longer to debug than it took to write.

It sounds like your bug(s) are hiding - to find them, you’re going to have to start looking. Comment code out piece by piece. Insert console.log() statements. Bug hunting is not always fun, but it’s definitely a necessary skill to learn.

Once you have found (or suspect you have found) the trouble code, we can start honing in here on the forum.

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [October 4, 2018, 3:31am UTC](https://discourse.processing.org/t/simultaneous-keys-press-at-the-same-time/4105/7 "2018-10-04T03:31:48Z")

</div>

> [@zng](#):
>
> Is there anywhere i can upload the code?

> [@Searching for coding help in Processing3](https://discourse.processing.org/t/searching-for-coding-help-in-processing3/1851/7):
>
> For a sketch w/ assets, like images, audios, videos, fonts, etc., you can create a repo for it at [GitHub.com](http://GitHub.com): [Create a repo - GitHub Docs](https://Help.GitHub.com/articles/create-a-repo/) And then drag & drop your whole sketch folder into it:
