---
title: Detecting button presses
slug: detecting-button-presses
createdAt: 2021-10-12T15:29:32.000Z
---

The ARxWear headset features 5 physical raised push buttons.

Each button is referenced like so:

```kotlin
        ArxButton.Circle
        ArxButton.Square
        ArxButton.Triangle
        ArxButton.VolumeDown
        ArxButton.VolumeUp
```

&#x20;By default no functions are associated with the buttons, it is up to you to assign them. In order to detect button click use the following override function in your MainActivity:

```kotlin
    override fun onButtonClick(button: ArxButton) {
        if(button == ArxButton.Circle){
            Snackbar.make(
                    findViewById<UVCCameraTextureView>(R.id.camera_view),
                    "Circle button short press",
                    Snackbar.LENGTH_LONG
            ).show()
        }
    }
```

For long click, use the following:

```kotlin
    override fun onButtonLongClick(button: ArxButton) {
        if(button == ArxButton.Circle){
            Snackbar.make(
                    findViewById<UVCCameraTextureView>(R.id.camera_view),
                    "Circle button long press",
                    Snackbar.LENGTH_LONG
            ).show()
        }
    }
```

