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

The touch panel over the NanoKVM-Go's LCD.

Subscribers receive, in the display's pixels from the top left corner:

  * `{NanoKVMGo.Touch, {:down, x, y}}` when a finger touches
  * `{NanoKVMGo.Touch, {:move, x, y}}` while it moves
  * `{NanoKVMGo.Touch, {:up, x, y}}` when it lets go, where it was last

The panel reaches a little below the display: there `y` is past its last
row.

## Options

  * `:name` - the name to register, `NanoKVMGo.Touch` by default
  * `:device` - the input device, by default the one of the panel's
    driver (`hynitron-cst816x`)
  * `:program` - the port program that reads it, the library's
    `nano_kvm_go_input` by default

# `message`

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

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 touches 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*
