# `NanoKVMGo.Button`
[🔗](https://github.com/cocoa-xu/nano_kvm_go/blob/v0.4.0/lib/nano_kvm_go/button.ex#L1)

The NanoKVM-Go's BOOT button, beside the USB port. Held at power-on it
starts the stock firmware's recovery; while the system runs it is free for
the application.

Subscribers receive `{NanoKVMGo.Button, :down}` and `{NanoKVMGo.Button, :up}`.

## Options

  * `:name` - the name to register, `NanoKVMGo.Button` by default
  * `:device` - the input device, by default the one of the GPIO keys
  * `:program` - the port program that reads it, the library's
    `nano_kvm_go_input` by default

# `message`

```elixir
@type message() :: {NanoKVMGo.Button, :down | :up}
```

A message to subscribers, see the module documentation.

# `option`

```elixir
@type option() ::
  {:name, GenServer.name()} | {:device, Path.t() | nil} | {:program, Path.t()}
```

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `start_link`

```elixir
@spec start_link([option()]) :: GenServer.on_start()
```

Starts the process. See the module documentation for the options.

# `subscribe`

```elixir
@spec subscribe(GenServer.server()) :: :ok
```

Sends presses to the caller until it unsubscribes or exits.

# `unsubscribe`

```elixir
@spec unsubscribe(GenServer.server()) :: :ok
```

Stops sending to the caller.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
