# GPIO with keyPressed()

**URL:** https://discourse.processing.org/t/gpio-with-keypressed/5592
**Category:** Processing for Pi
**Created:** [November 16, 2018, 10:26am UTC](https://discourse.processing.org/t/gpio-with-keypressed/5592 "2018-11-16T10:26:48Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Jerome](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jerome/32/2386_2.png) [@Jerome](https://discourse.processing.org/u/Jerome)
#### Post date: [November 16, 2018, 10:26am UTC](https://discourse.processing.org/t/gpio-with-keypressed/5592/1 "2018-11-16T10:26:48Z")

</div>

Hello!

I use my Raspberry Pi with Processing and a GPIO push button. Every tests I made worked fine. But I need with this button something equivalent to the function keyPressed(). Is it possible?  
Or must I map the GPIO button to a key keyboard?

Thanks for your help.

---

<div class="post-metadata">

### Author: ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)
#### Post date: [November 17, 2018, 1:19am UTC](https://discourse.processing.org/t/gpio-with-keypressed/5592/2 "2018-11-17T01:19:23Z")

</div>

hi @Jerome  
can you show ( just a little ) code how you read the GPIO push button,  
and a example where you failed to save it to a variable like

```auto
boolean this_GPIO_push_button_is_pressed ;

```

there is a issue about that every push button input “flickers”  
see a example from arduino what i mean and about how to deal with it.

[https://www.arduino.cc/en/Tutorial/Debounce](https://www.arduino.cc/en/Tutorial/Debounce)
