---
name: "JSGetButtonState"
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/JSGetButtonState"
---

# JSGetButtonState(3)

Button state retrieving

## NAME

JSGetButtonState - Button state retrieving

## SYNTAX

\#include \<jsw.h\>

int JSGetButtonState(\
\
         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 JSGetButtonState function returns the state of the specified button *n* at its last updated state on the given *jsd* structure.

## RETURN VALUE

The JSGetButtonState function returns one of the following:

- JSButtonStateOff

  Specifies that the button is in its released state.

- JSButtonStateOn

  Specifies that the button is in its pressed state.

## SEE ALSO

[JSIntro(3)](/JSIntro/3.md) [JSIsButtonAllocated(3)](/JSIsButtonAllocated/3.md) [JSUpdate(3)](/JSUpdate/3.md)
