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
- Host: GitHub
- URL: https://github.com/mishamyrt/nuga-lib
- Owner: mishamyrt
- License: mit
- Created: 2023-12-30T02:22:40.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-29T20:02:08.000Z (almost 2 years ago)
- Last Synced: 2025-04-24T07:42:24.136Z (11 months ago)
- Topics: byk916, nuphy, reverse-engineering, usb-hid
- Language: Go
- Homepage:
- Size: 235 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
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.