An open API service indexing awesome lists of open source software.

https://github.com/mishamyrt/nuga-lib

⌨️ Go interface for BYK916 NuPhy® keyboards
https://github.com/mishamyrt/nuga-lib

byk916 nuphy reverse-engineering usb-hid

Last synced: 9 months ago
JSON representation

⌨️ Go interface for BYK916 NuPhy® keyboards

Awesome Lists containing this project

README

          


Nuga library Logo

Nuga library


Go interface for BYK916 NuPhy® keyboards









---

This library provides the ability to control keyboard parameters through the HID USB interface. It is used in [Nuga.app](https://github.com/mishamyrt/nuga-app).

## Usage

First of all, add a library module to your project.

```sh
go get -u github.com/mishamyrt/nuga-lib@latest
```

Use the `nuga.Open()` method to get the keyboard controller. It allows you to control the keyboard. For example, the brightness can be changed.

```go
package main

import (
"github.com/mishamyrt/nuga-lib"
)

func main() {
// Setup HID
nuga.Init()
defer nuga.Exit()
// Open connection with keyboard
device, _ := nuga.Open()
// Read current effects
effects, _ := device.Features.Light.GetEffects()
// Set brightness to 50%
effects.Backlight.SetBrightness(2)
// Write effects
_ = device.Features.Light.SetEffects(effects)
}
```

## Terminology

- Mode — keyboard light mode;
- Effect — combination of color, speed, brightness and light mode.

## Protocol

The library is based on reverse-engineering of the keyboard protocol. The knowledge that was obtained is recorded in the [`docs`](./docs/) folder.

## Trademarks

NuPhy® is a registered trademark of NuPhy Studio. Nuga is an unofficial product and is not affiliated with NuPhy Studio.