# Why doesn't processing recognize the key? (keyReleased)

**URL:** https://discourse.processing.org/t/why-doesnt-processing-recognize-the-key-keyreleased/21777
**Category:** Beginners
**Created:** [June 11, 2020, 4:18pm UTC](https://discourse.processing.org/t/why-doesnt-processing-recognize-the-key-keyreleased/21777 "2020-06-11T16:18:22Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Moritz](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@Moritz](https://discourse.processing.org/u/Moritz)
#### Post date: [June 11, 2020, 4:18pm UTC](https://discourse.processing.org/t/why-doesnt-processing-recognize-the-key-keyreleased/21777/1 "2020-06-11T16:18:23Z")

</div>

Hi guys,  
why doesn’t Processing recognize the ‘e’ key when the ‘s’ and ‘d’ or ‘w’ and ‘d’ keys are already pressed?

```auto
// Click on the image to give it focus,
// and then press any key.

int value = 0;

void draw() {
  fill(value);
  rect(25, 25, 50, 50);
}

void keyReleased() {
  if (value == 0) {
    value = 255;
  } else {
    value = 0;
  }
}
// processing example

```

---

<div class="post-metadata">

### Author: ![slow\_izzm](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/slow_izzm/32/5637_2.png) [@slow\_izzm](https://discourse.processing.org/u/slow_izzm)
#### Post date: [June 11, 2020, 7:07pm UTC](https://discourse.processing.org/t/why-doesnt-processing-recognize-the-key-keyreleased/21777/2 "2020-06-11T19:07:30Z")

</div>

[https://landing.coolermaster.com/faq/anti-ghosting/](https://landing.coolermaster.com/faq/anti-ghosting/)

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [June 11, 2020, 7:10pm UTC](https://discourse.processing.org/t/why-doesnt-processing-recognize-the-key-keyreleased/21777/3 "2020-06-11T19:10:18Z")

</div>

The number of simultaneous key press / releases that your system will detect is hardware specific. In general, most consumer keyboards are not designed to signal certain key combinations – in particular, a cluster of two neighboring keys on a row plus a neighbor directly above or below seldom works.

This isn’t a limitation of Processing – your keyboard is literally not generating an “e” signal when you hold down s+d first.

I can test this on macOS by opening my OS keyboard viewer, holding down s and d (they light up) then pressing e (it doesn’t light up). Holding down any two keys on the home row and then typing a key above or below seems to fail.

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [June 11, 2020, 7:13pm UTC](https://discourse.processing.org/t/why-doesnt-processing-recognize-the-key-keyreleased/21777/4 "2020-06-11T19:13:45Z")

</div>

See also “rollover”:

[https://en.wikipedia.org/wiki/Rollover\_(key)#:~:text=Certain%20high-end%20keyboards%20have,held%20down%20at%20the%20time](https://en.wikipedia.org/wiki/Rollover_(key)#:~:text=Certain%20high%2Dend%20keyboards%20have,held%20down%20at%20the%20time).
