Control your Anne Pro 2 RGBs with NodeJS
Anne Pro 2 RGB control through Node.js
This Node.js module allows controlling the Anne Pro 2 RGB keyboard keys without ObinsKit. Anne Pro 1 compatibility has not been tested as I don’t have that keyboard.
Currently, settings are not saved and custom LED graphics set with this module are lost when the keyboard loses power or when user changes the profile with a keyboard button. This works similarly to the profile preview mode in ObinsKit.
Windows, Linux, OSX:
npm install -g annemone
CLI currently only supports setting the entire keyboard to one color.
As an Node package:
var Annemone = require('annemone')
const LEDController = new Annemone.LEDController();
Set keyboard to red:
annemone single 255 0 255
Set per-key RBG value.
Accepts a two-dimensional matrix with RGB values corresponding to each of the 61 keys as they appear on the keyboard.
There’s a delay between commands as the keyboard doesn’t understand commands that are sent faster than 50ms apart. This is also compounded by the fact that HID doesn’t have high data throughput rate. Consider using the setSingleColorLed
method if your application don’t need to set per-key color.
Example matrix:
[
[255, 0, 0] // esc
[255, 0, 0] // 1
[255, 0, 0] // 2
...
],
[
[255, 0, 0] // tab
[255, 0, 0] // q
[255, 0, 0] // w
...
]
...
Alternative way to set individual key colors. Takes an object with each key and its corresponding color like this: { f: [255,0,0], esc: [0,255,255]}
Note that this function is not aware of the current keyboard state and will turn off all LEDs not specified in the input object.
Set all keys to one color.
Takes an array with 3 elements: red, green and blue.
Example RGB: [255, 0, 0]
HID packet generator for setMultiColorLed
.
HID packet generator for setSingleColorLed
.
HID write wrapper with a forced delay.
Needed due to Anne Pro 2 ignoring commands when they’re sent faster than 50ms apart from each other.
To install a local version for development purposes, use the following set of commands:
git clone https://github.com/illixion/Annemone.git
cd Annemone
npm i
Now that you have a local version of Annemone, you can use these commands in Node to import it locally:
var Annemone = require("./index.js");
const LEDController = new Annemone.LEDController();
Distributed under the MIT license. See LICENSE
for more information.
See also the list of contributors who participated in this project.
git checkout -b feature/fooBar
)git commit -am 'Add some fooBar'
)git push origin feature/fooBar
)