> For the complete documentation index, see [llms.txt](https://documentation.hak5.org/packet-squirrel/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.hak5.org/packet-squirrel/payload-development/the-button-command.md).

# The BUTTON Command

`BUTTON` is a Ducky Script command for the Packet Squirrel which pauses the payload until either the hardware push-button has been momentarily depressed, or an optionally specified time has elapsed.

In the event that a time is specified, `BUTTON` will exit with a non zero return code if the push-button is not pressed in the given time, and zero if the push-button was pressed.

```
BUTTON 1m && {
  echo "button pressed"
} || {
  echo "button not pressed"
}
```

If no time is specified the `BUTTON` command will pause indefinitely until the push-button is pressed.

During this pause, the `LED` will light the `SPECIAL` status, meaning a solid cyan color which blinks off for 100 ms every second.

Time may be specified in (s)econds, (m)inutes, (h)ours or (d)ays. For example:

```
BUTTON 10s # Wait for 10 seconds for button press
BUTTON 30m # Wait for 30 minutes for button press
BUTTON 365d # Wait 1 year for button press
BUTTON # wait indefinitely for button press
```

The special LED status light may be suppressed by setting the `NO_LED` environment variable to 1.

```
NO_LED=1 BUTTON 1m
```
