# Capturing game controller button events in Processing for Android

**URL:** <https://discourse.processing.org/t/capturing-game-controller-button-events-in-processing-for-android/40073>\
**Category:** Processing for Android\
**Created:** [December 8, 2022, 6:41pm UTC](https://discourse.processing.org/t/capturing-game-controller-button-events-in-processing-for-android/40073 "2022-12-08T18:41:05Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)\
**Post date:** [December 10, 2022, 2:07am UTC](https://discourse.processing.org/t/capturing-game-controller-button-events-in-processing-for-android/40073/5 "2022-12-10T02:07:54Z")

</div>

Hi Sir  
Maybe I am far about your topic  
But Easy way to do it

1- If the controller connect via Bluetooth I think it’s easy to capture the key’s code as array and use it in sketch

2-You can read Bluetooth key code if you want using Serial Bluetooth Terminal App for Android

 ![screen-2](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/e/5/e5d307c4691f3e8640434eca8bf07db72de02933.webp)

3 -for USB I found one library support USB for Android make connection with Arduino (not all kinds of Arduino) I don’t know if it’s support game controller

Here is example to receive Bluetooth

> [@Android Bluetooth](https://discourse.processing.org/t/android-bluetooth/27140):
>
> The Ketai Bluetooth Class method onBluetoothDataEvent() does not work on the latest Android modes. Also, it has no readStringUntil() method which makes it difficult to read fast incoming data. So I wrote a native Android Bluetooth code to make this possible. I tested it on a MultiLaser Lollipop 5.1 device, as well as on a Samsung Android 10, using an HC-05 module set to a baud rate of 115200, without losing a single reading byte. The first code is the simplest reading code, it will display a sin…

---

_[View the full topic](https://discourse.processing.org/t/capturing-game-controller-button-events-in-processing-for-android/40073)._
