---
name: "JSIsButtonAllocated"
section: "3"
platform: "linux"
package: "libjsw-dev"
version: "1:1.5.5-1+b1"
release: "Debian 5.0 (Lenny)"
platforms: ["linux"]
url: "https://new.carta.tech/JSIsButtonAllocated"
---

# JSIsButtonAllocated(3)

Button number validation

## NAME

JSIsButtonAllocated - Button number validation

## SYNTAX

\#include \<jsw.h\>

int JSIsButtonAllocated(\
\
         js\_data\_struct \**jsd*,\
\
         int *n*\
 )

## ARGUMENTS

- *jsd*

  Specifies the pointer to the joystick data structure, which should have been set up by a prior call to JSInit.

- *n*

  Specifies the button number.

## DESCRIPTION

The JSIsButtonAllocated function checks if the given button number *n* exists on the given *jsd* structure.

## RETURN VALUE

The JSIsButtonAllocated function returns zero if the button does not exist or 1 if the button does exist.

## SEE ALSO

[JSIntro(3)](/JSIntro/3.md) [JSIsAxisAllocated(3)](/JSIsAxisAllocated/3.md)
