---
name: "SDL_HINT_ANDROID_TRAP_BACK_BUTTON"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_HINT_ANDROID_TRAP_BACK_BUTTON"
---

# SDL\_HINT\_ANDROID\_TRAP\_BACK\_BUTTON(3)

A variable to control whether we trap the Android back button to handle it manually.

## NAME

SDL\_HINT\_ANDROID\_TRAP\_BACK\_BUTTON - A variable to control whether we trap the Android back button to handle it manually.

## HEADER FILE

Defined in SDL3/SDL\_hints.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**#define SDL\_HINT\_ANDROID\_TRAP\_BACK\_BUTTON** *SDL\_ANDROID\_TRAP\_BACK\_BUTTON"*

## DESCRIPTION

This is necessary for the right mouse button to work on some Android devices, or to be able to trap the back button for use in your code reliably. If this hint is true, the back button will show up as an

**SDL\_EVENT\_KEY\_DOWN**\
  /

**SDL\_EVENT\_KEY\_UP**\
  pair with a keycode of

**SDL\_SCANCODE\_AC\_BACK** .

The variable can be set to the following values:

• "0": Back button will be handled as usual for system. (default)

• "1": Back button will be trapped, allowing you to handle the key press\
   manually. (This will also let right mouse click work on systems where the\
   right mouse button functions as back.)

This hint can be set anytime.

## AVAILABILITY

This hint is available since SDL 3.2.0.
