Giter Club home page Giter Club logo

msi-keyboard's Introduction

MSI Keyboard LED Controller

OS independent* LED Controller for MSI Steelseries laptop keyboards Using Node.js

NPM version

Information

Packagemsi-keyboard
Description MSI Keyboard LED Controller
Hardware MSI GE, GT Steelseries Keyboard
Node Version >= 0.4

keyboard

Usage

Make sure you have the needed usb lib requirements for your OS.

This project now supports full RGB/hex colors.

Generic Linux: libusb-dev libusb-1.0-0-dev

Use it as command line :

https://github.com/Kwaadpepper/msi-keyboard-CLI

if using as a stand alone module:

npm install

Note:

Linux and *nix systems may require sudo to access the hid device interface.

*Not tested on all platforms. Platform tests appreciated

// require the LED module
var keyboard = require('msi-keyboard')();

// Set left region to high intensity, color red
keyboard.color('left', {
  color: 'red',
  intensity: 'high'
});

// Set middle region to green default high intensity
keyboard.color('middle', 'green');


// Set right region to blue with light intensity
keyboard.color('right', {
  color: 'blue',
  intensity: 'light',
});


// Hardware modes
// Setting .color() will Not affect the hardware defined colors for modes

// Set Hardware mode to breath
keyboard.mode('breathe', 'green');


// Blinking
// Set the keyboard.color() Before calling .blink()
// Refer to examples/blinkMulti.js

// Blink all the keyboard LEDs to 750ms
keyboard.blink(750);


// Blink Only left and right regions at 750ms
keyboard.blink(['left','right'], 750);


// Use the default blink, time: 1000ms
keyboard.blink();


// Stop the blink after 5000ms
setTimeout(keyboard.stopBlink, 5000);

Colors

keyboard.colors(String region, String Color);

Colors must be set before using keyboard.blink();

They will not affect hardware-default modes such as Wave and Breathing.

All colors supported by Colors.js are now supported here

To set a color use keyboard.colors() There are two ways to set the color to a region:

keyboard.color('middle', 'green');
keyboard.color('middle', {color:'#ffffff', intensity:'high'});
keyboard.color('middle', {color:'#4654BD', intensity:'high'});

Intensity

keyboard.colors(String region, {String color, String intensity});

The color intensity to white can be set via keyboard.colors();

The following intensities are used:

light
low
med
high

To set it:

keyboard.color('right', {
  color: '#1CA626',
  intensity: 'med',  // light, low, med, high
});

##Modes keyboard.mode(String mode, String primaryColor, String secondaryColor); keyboard.mode(String mode, Object left, Object middle, Object right, Integer cyclePeriod);

MSI Steelseries keyboards have built modes.

Breathe and Wave modes support fading between colors, which can be set when calling the keyboard.mode() method.

Passing in only one color argument defaults the secondaryColor to 'black':

keyboard.mode(String mode, String primaryColor);

You can also set each region's color individually:

keyboard.mode(String mode, String leftPrimary, String middlePrimary, String rightPrimary, Integer cyclePeriod);

keyboard.mode(String mode, Object left, Object middle, Object right, Integer cyclePeriod);

Region objects are defined as such:

right: {
  primary: {
    color: 'red',
    intensity: 'high'
  },
  secondary: {
    color: 'blue',
    intensity: 'high'
  }
}

Which is equivalent to:

right: {
  color: 'red',
  intensity: 'high',
  secondary: {
    color: 'blue',
    intensity: 'high'
  }
}

You can also define just the primary and secondary colors, leaving the intensities to their default (high):

right: {
  primary: 'red',
  secondary: 'blue'
}

If you specify the color and intensity directly in the Region object, you can set just one of the secondary fields and the other will take the default from the primary (secondary color will be red with light intensity):

right: {
  color: 'red',
  intensity: 'high',
  secondary: {intensity:'light'}
}

The cyclePeriod defaults to 2 seconds when not passed in.

The modes defined by the hardware are:

Normal
Gaming
Breathe
Demo
Wave

Usage:

keyboard.mode('breathe', 'green', 'red', 'yellow');

##Regions keyboard.colors(String region, String color);

There are three regions on the Steelseries keyboard:

Left
Middle
Right

Each can have a color and intensity set.

##Blink keyboard.blink(Time milliseconds);

The time is the speed in which the keyboard is to blink.

keyboard.colors(); Must be set before using keyboard.blink();

Usage:

// keyboard.color(...);


keyboard.blink(750);

To blink one, or two regions only:

// keyboard.color(...);


keyboard.blink(['left','right'], 750);

Examples

You can view more examples in the example folder.

Confirmed Systems

OS: Debain 8
Kernel: Linux 4.4.0 AMD
Node: v5 / v6
libusb-dev: v0.1.12

---

OS: Arch Linux
Kernel: 4.5.1-1-ARCH
Node: v6.0.0
libusb v0.1.12


---

OS: Ubuntu 16.04
Kernel: 4.4.14
Node: v6
libusb v0.1.12

LICENSE

(MIT License)

Copyright (c) 2013 | Steve Lacy (http://slacy.me)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

msi-keyboard's People

Contributors

ansidev avatar asaparov avatar au-phiware avatar halpomeranz avatar hussainq avatar jedsdesk avatar stellarpower avatar stephenlacy avatar stevelacy avatar yocontra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

msi-keyboard's Issues

MSI GT72-Dominator PRO Error: cannot open device with vendor id 0x1770 and product id 0xff00

When trying to run

var keyboard = require('msi-keyboard');

keyboard.color('left', {
    color: 'red',
    intensity: 'med'
});
keyboard.color('middle', {
    color: 'green',
    intensity: 'med'
});
keyboard.color('right', {
    color: 'blue',
    intensity: 'med',
});

keyboard.mode('breathe');

keyboard.blink(['left'], 750);

setTimeout(keyboard.stopBlink, 5000);

The following error is shown

    this._raw = new (Function.prototype.bind.apply(binding.HID,
                ^

Error: cannot open device with vendor id 0x1770 and product id 0xff00
    at Error (native)
    at new HID (/home/joel/Documents/Personal/msi-klm/node_modules/msi-keyboard/node_modules/node-hid/nodehid.js:28:14)
    at module.exports (/home/joel/Documents/Personal/msi-klm/node_modules/msi-keyboard/lib/findKeyboard.js:7:14)
    at Object.<anonymous> (/home/joel/Documents/Personal/msi-klm/node_modules/msi-keyboard/index.js:3:18)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)

unmet dependency node-hid

Hi, thanks for this feature!

After cloning repository and "sudo npm install", all packages are properly installed except "node-hid". I get several error messages during installation and finally a npm warning:

This failure might be due to the use of legacy binary "node"

I am using node v0.10.25, ubuntu 14.04 x64 and a msi ge60 2pe apachePro. I guess it has to be with node-hid package and not yours, buy anyway one of the dependencies of your package seems broken.

Launch on restart ?

First of all thanks a lot for making this. It's great. I have two simple questions though. I'm not extremely experienced with Linux so excuse me if there .."bad"
I got it installed but I have to launch it from nautilus (because of the permissions error) every time I restart. Which isn't bad but its just a process I'd like to shorten if possible. Is there a way to stop the error when trying to launch and make it start up when I login ?

Thanks Dany

Configure Error when trying to install

I used this on Ubuntu 14.10 and loved it, but I accidentally deleted my home folder and decided to install 15.04 fresh. This is one of the things I'm trying to reinstall, but it doesn't want to install. This is the error I'm getting:

$ sudo npm install

> [email protected] install /home/aidan/Code/MSI-Backlight/msi-keyboard/node_modules/node-hid
> node-gyp rebuild

/bin/sh: 1: node: not found
gyp: Call to 'node -e "require('nan')"' returned exit status 127. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:344:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.19.0-18-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/aidan/Code/MSI-Backlight/msi-keyboard/node_modules/node-hid
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok 
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the node-hid package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls node-hid
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.19.0-18-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/aidan/Code/MSI-Backlight/msi-keyboard
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/aidan/Code/MSI-Backlight/msi-keyboard/npm-debug.log
npm ERR! not ok code 0

Any help? Thanks in advance if so!

color for off?

I need a no-color.js script.
I simply want to turn off the RGB keyboard at times.
Can someone make one?
Thanks

Segfault on GS60

I have the gs60 pro 4k with steelseries keyboard and I'm trying to change the mode, but the program segfaults:

Core was generated by `node msi-run.js'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 instance_type (this=<error reading variable: Cannot access memory at address 0x0>) at ../src/objects-inl.h:3007

3007 ../src/objects-inl.h: No such file or directory.
(gdb) bt
#0 instance_type (this=<error reading variable: Cannot access memory at address 0x0>) at ../src/objects-inl.h:3007
#1 IsString (this=0x1) at ../src/objects-inl.h:177
#2 VerifyApiCallResultType (this=0x1) at ../src/objects-inl.h:1718
#3 HandleApiCallHelper (isolate=0x19fe070, args=...) at ../src/builtins.cc:1152
#4 v8::internal::Builtin_HandleApiCallConstruct (args=..., isolate=0x19fe070) at ../src/builtins.cc:1169
#5 0x0000032290206362 in ?? ()
#6 0x0000000001a5dfd0 in ?? ()
#7 0x00000322902062c1 in ?? ()
#8 0x00007fff3e30a4e0 in ?? ()
#9 0x00007fff3e30a550 in ?? ()
#10 0x000003229020d4f6 in ?? ()
#11 0x0000281ef0658af9 in ?? ()
#12 0x0000ff0000000000 in ?? ()
#13 0x0000177000000000 in ?? ()
#14 0x000032be7df5c979 in ?? ()
#15 0x000032be7df5c979 in ?? ()
#16 0x0000000200000000 in ?? ()
#17 0x000003229020d321 in ?? ()
#18 0x0000000700000000 in ?? ()
#19 0x000032be7df0d009 in ?? ()
#20 0x00007fff3e30a598 in ?? ()
#21 0x000003229020d7aa in ?? ()
#22 0x0000ff0000000000 in ?? ()
#23 0x0000177000000000 in ?? ()
#24 0x0000281ef0607c19 in ?? ()
#25 0x0000281ef0658af9 in ?? ()
#26 0x000003229020d701 in ?? ()
#27 0x0000000600000000 in ?? ()
#28 0x0000000000000000 in ?? ()

Any idea what's going on? I'm using Ubuntu 14.04 64-bit and this is the contents of the file I'm running:

var keyboard = require('msi-keyboard');

keyboard.mode('normal');

[MSI GP72 6QE] Doesn't work

Hi,
I would like to activate backlight for my keyboard but I have no result.
In fact, I can start your app (I have the panel with colors selection) but no backlight (evenless different colors).
Thanks

How to determine new configurations / support for MSI GE63VR

I tried to get this project (and other C++ siblings) running on my GE63VR SteelSeries laptop, so far without success.

In the normal configuration the usb vendor and device id are off, so that's already an indicator something has changed, the hex ID's are now 1038:1122. But even if I change those I will get no feedback from the keyboard.

The backlighting itself works very well, it keeps changing colors in a flow manner all the time, I don't know what the mode is called. I never booted Windows since I need the laptop for work, but be very glad to have a constant backlight on the keyboard.

So, my key question is, to determine for myself how I can work out the correct code to send to the USB device, if it has changed. Where did you get your original information about this? Although I'd prefer a lightweight C++ implementation I would be happy to share any results (if I can produce any).

Cannot find module

Hello,

After I installed the necessary modules by typing 'npm install' and run an example from the program "nodejs examples/blink.js" I get the following error: Cannot find module '/home/michel/Downloads/.msi-keyboard/node_modules/node-hid/build/HID/v0.5.1/Release/node-v11-linux-x64/HID.node'.

If I check the folders there is no node-v11-linux-x64. Only a node-v47-linux-x64

Please help

Origin evo15-s

I have an Origin evo15-s, which to my knowledge shares the same keyboard with the msi gs60, but none of the example scripts or my own seem to work. It sits on the default red color and doesn't change.

I ran

var hid = require('node-hid');
console.log(hid.devices());

var board = new hid.HID(6000, 65280);
console.log(board);

and got

[ { vendorId: 6000,
    productId: 65280,
    path: '0004:0003:00',
    serialNumber: 'MSI EPF USB',
    manufacturer: 'MSI EPF USB',
    product: 'MSI EPF USB',
    release: 272,
    interface: 0 }]

{ domain: null,
  _events: { newListener: [Function] },
  _maxListeners: 10,
  _raw: {},
  read: [Function],
  write: [Function],
  getFeatureReport: [Function],
  sendFeatureReport: [Function],
  setNonBlocking: [Function],
  _paused: true }

So it appears to indeed be an MSI board.

My intent is to make up for Origin pc's lack of keyboard control, even though the hardware should be customizable.

Any thoughts?

Thanks.

Error on New Version of NODE_MODULE_VERSION Needed

I am now generating this error when I try to run "node example/color.js":

Error: The module '/node_modules/node-hid/build/Release/HID.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 57. This version of Node.js requires
NODE_MODULE_VERSION 64. Please try re-compiling or re-installing
the module (for instance, using npm rebuild or npm install).
at Object.Module._extensions..node (internal/modules/cjs/loader.js:707:18)
at Module.load (internal/modules/cjs/loader.js:589:32)
at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
at Function.Module._load (internal/modules/cjs/loader.js:520:3)
at Module.require (internal/modules/cjs/loader.js:626:17)
at require (internal/modules/cjs/helpers.js:20:18)
at bindings (/home//node_modules/bindings/bindings.js:81:44)
at Object. (/home/
/node_modules/node-hid/nodehid.js:5:34)
at Module._compile (internal/modules/cjs/loader.js:678:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)

When I try to rebuild in the msi-keyboard folder I get the following:

******@ghost:[msi-keyboard] $ npm install

[email protected] install /home/******/build/msi-keyboard/node_modules/node-hid
prebuild-install || node-gyp rebuild

prebuild-install info begin Prebuild-install version 2.4.1
prebuild-install info looking for local prebuild @ prebuilds/node-hid-v0.5.7-node-v64-linux-x64.tar.gz
prebuild-install info looking for cached prebuild @ /home//.npm/_prebuilds/https-github.com-node-hid-node-hid-releases-download-v0.5.7-node-hid-v0.5.7-node-v64-linux-x64.tar.gz
prebuild-install http request GET https://github.com/node-hid/node-hid/releases/download/v0.5.7/node-hid-v0.5.7-node-v64-linux-x64.tar.gz
prebuild-install http 404 https://github.com/node-hid/node-hid/releases/download/v0.5.7/node-hid-v0.5.7-node-v64-linux-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=10.0.0 runtime=node arch=x64 platform=linux)
make: Entering directory '/home/
/build/msi-keyboard/node_modules/node-hid/build'
CC(target) Release/obj.target/hidapi/hidapi/libusb/hid.o
../hidapi/libusb/hid.c: In function ‘hid_read_timeout’:
../hidapi/libusb/hid.c:1078:6: warning: variable ‘bytes_read’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
int bytes_read = -1;
^~~~~~~~~~
AR(target) Release/obj.target/hidapi.a
COPY Release/hidapi.a
CXX(target) Release/obj.target/HID/src/HID.o
In file included from ../src/HID.cc:31:0:
../../nan/nan.h: In function ‘v8::Localv8::Value Nan::MakeCallback(v8::Localv8::Object, v8::Localv8::Function, int, v8::Localv8::Value)’:
../../nan/nan.h:840:60: warning: ‘v8::Localv8::Value node::MakeCallback(v8::Isolate
, v8::Localv8::Object, v8::Localv8::Function, int, v8::Localv8::Value)’ is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
v8::Isolate::GetCurrent(), target, func, argc, argv);
^
In file included from ../src/HID.cc:30:0:
/home/
/.node-gyp/10.0.0/include/node/node.h:172:50: note: declared here
NODE_EXTERN v8::Localv8::Value MakeCallback(
^
/home/
/.node-gyp/10.0.0/include/node/node.h:88:42: note: in definition of macro ‘NODE_DEPRECATED’
attribute((deprecated(message))) declarator
^~~~~~~~~~
In file included from ../src/HID.cc:31:0:
../../nan/nan.h: In function ‘v8::Localv8::Value Nan::MakeCallback(v8::Localv8::Object, v8::Localv8::String, int, v8::Localv8::Value
)’:
../../nan/nan.h:855:62: warning: ‘v8::Localv8::Value node::MakeCallback(v8::Isolate*, v8::Localv8::Object, v8::Localv8::String, int, v8::Localv8::Value)’ is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
v8::Isolate::GetCurrent(), target, symbol, argc, argv);
^
In file included from ../src/HID.cc:30:0:
/home/
/.node-gyp/10.0.0/include/node/node.h:165:50: note: declared here
NODE_EXTERN v8::Localv8::Value MakeCallback(
^
/home/
/.node-gyp/10.0.0/include/node/node.h:88:42: note: in definition of macro ‘NODE_DEPRECATED’
attribute((deprecated(message))) declarator
^~~~~~~~~~
In file included from ../src/HID.cc:31:0:
../../nan/nan.h: In function ‘v8::Localv8::Value Nan::MakeCallback(v8::Localv8::Object, const char
, int, v8::Localv8::Value)’:
../../nan/nan.h:870:62: warning: ‘v8::Localv8::Value node::MakeCallback(v8::Isolate
, v8::Localv8::Object, const char*, int, v8::Localv8::Value)’ is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
v8::Isolate::GetCurrent(), target, method, argc, argv);
^
In file included from ../src/HID.cc:30:0:
/home/
/.node-gyp/10.0.0/include/node/node.h:158:50: note: declared here
NODE_EXTERN v8::Localv8::Value MakeCallback(
^
/home/
/.node-gyp/10.0.0/include/node/node.h:88:42: note: in definition of macro ‘NODE_DEPRECATED’
attribute((deprecated(message))) declarator
^~~~~~~~~~
In file included from ../src/HID.cc:31:0:
../../nan/nan.h: In member function ‘v8::Localv8::Value Nan::Callback::Call_(v8::Isolate
, v8::Localv8::Object, int, v8::Localv8::Value) const’:
../../nan/nan.h:1484:5: warning: ‘v8::Localv8::Value node::MakeCallback(v8::Isolate
, v8::Localv8::Object, v8::Localv8::Function, int, v8::Localv8::Value)’ is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
));
^
In file included from ../src/HID.cc:30:0:
/home/
/.node-gyp/10.0.0/include/node/node.h:172:50: note: declared here
NODE_EXTERN v8::Localv8::Value MakeCallback(
^
/home/
/.node-gyp/10.0.0/include/node/node.h:88:42: note: in definition of macro ‘NODE_DEPRECATED’
attribute((deprecated(message))) declarator
^~~~~~~~~~
../src/HID.cc: At global scope:
../src/HID.cc:67:5: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
throw(JSException);
^~~~~
../src/HID.cc:70:5: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
throw(JSException);
^~~~~
../src/HID.cc:152:3: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
throw(JSException)
^~~~~
../src/HID.cc:163:3: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
throw(JSException)
^~~~~
../src/HID.cc: In member function ‘void HID::readResultsToJSCallbackArguments(HID::ReceiveIOCB
, v8::Localv8::Value)’:
../src/HID.cc:207:74: error: no matching function for call to ‘v8::Function::NewInstance(int, v8::Localv8::Value [1])’
Local buf = nodeBufConstructor->NewInstance(1, nodeBufferArgs);
^
In file included from /home//.node-gyp/10.0.0/include/node/node.h:63:0,
from ../src/HID.cc:30:
/home/
/.node-gyp/10.0.0/include/node/v8.h:3848:44: note: candidate: v8::MaybeLocalv8::Object v8::Function::NewInstance(v8::Localv8::Context, int, v8::Localv8::Value) const
V8_WARN_UNUSED_RESULT MaybeLocal NewInstance(
^~~~~~~~~~~
/home//.node-gyp/10.0.0/include/node/v8.h:3848:44: note: candidate expects 3 arguments, 2 provided
/home/
/.node-gyp/10.0.0/include/node/v8.h:3851:44: note: candidate: v8::MaybeLocalv8::Object v8::Function::NewInstance(v8::Localv8::Context) const
V8_WARN_UNUSED_RESULT MaybeLocal NewInstance(
^~~~~~~~~~~
/home//.node-gyp/10.0.0/include/node/v8.h:3851:44: note: candidate expects 1 argument, 2 provided
../src/HID.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE HID::New(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/HID.cc:409:62: warning: ‘v8::String::Value::Value(v8::Localv8::Value)’ is deprecated: Use Isolate version [-Wdeprecated-declarations]
serialPointer = (wchar_t
) v8::String::Value(info[2]);
^
In file included from /home/
/.node-gyp/10.0.0/include/node/v8.h:26:0,
from /home//.node-gyp/10.0.0/include/node/node.h:63,
from ../src/HID.cc:30:
/home/
/.node-gyp/10.0.0/include/node/v8.h:2846:51: note: declared here
V8_DEPRECATED("Use Isolate version", explicit Value(Localv8::Value obj));
^
/home//.node-gyp/10.0.0/include/node/v8config.h:318:3: note: in definition of macro ‘V8_DEPRECATED’
declarator attribute((deprecated(message)))
^~~~~~~~~~
make: *** [HID.target.mk:106: Release/obj.target/HID/src/HID.o] Error 1
make: Leaving directory '/home/
/build/msi-keyboard/node_modules/node-hid/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:225:12)
gyp ERR! System Linux 4.16.6-1-ARCH
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/******/build/msi-keyboard/node_modules/node-hid
gyp ERR! node -v v10.0.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: prebuild-install || node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Any input would be helpful.

Thanks,

raedeus

MSI Stealth

Hi,

First - thank you, I have been waiting over a year for this :-)

For the MSi Stealth GS70 series, only the blink example seams to work but nothing else. Unable to change colours or anything.

I have no errors to show, as there is no output other than setColor:

describe('msi-keyboard', function() {
^
ReferenceError: describe is not defined
at Object. (/home/phill/workspace/keyboard/test/setColor.js:6:1)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3

Hope you can help,
Best Regards,

Vary brightness, not just color intensity

Hello!

I think there may be a bug when using the intensity flag with the color flag which results in the overall brightness being doubled.

For example,if msikeyboard -i light results in a relative intensity of 1. Then msikeyboard -i light -c red results (in what appears to be) a relative intensity of 2.

(I am using msikeyboard but that just uses this project as a dependency for the real business logic)

Honestly, it looks like rather than diminishing the output of the backlight, it's adding 'white' to the red color to make it more washed out. Which a fine feature, but I think having a way to actually change the brightness of the backlight would be preferred.

Best,
Daniel

Fails Silently on GT72s Dominator Pro Dragon Edition

Hi,

Not sure what I've done wrong here, I've cloned and used npm install and am running the basic set colour testscript as root, the program returns successfully but nothing happens on my keyboard. I've tried pressing the kill switch but it doesn't seem to do anything. I'm new to node.js but have installed the 'Node Inspector' debugger and can have a look at what's happening when I have a bit more time. Please could you tell me, do you know what the issue could be?

Thanks

Python version not supported by gyp?

Can anyone help? This is the output I get after running 'npm install msi-keyboard'
Thanks..

[laughingman@MSIManjaro895 ~]$ npm install msi-keyboard
|
[email protected] preinstall /home/laughingman/node_modules/msi-keyboard/node_modules/node-hid
sh get-hidapi.sh

Cloning into 'hidapi'...
remote: Counting objects: 1965, done.
remote: Total 1965 (delta 0), reused 0 (delta 0), pack-reused 1965
Receiving objects: 100% (1965/1965), 2.79 MiB | 2.14 MiB/s, done.
Resolving deltas: 100% (1082/1082), done.
Checking connectivity... done.

[email protected] install /home/laughingman/node_modules/msi-keyboard/node_modules/node-hid
sh install.sh

gyp ERR! configure error
gyp ERR! stack Error: Python executable "python" is v3.4.3, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack at failPythonVersion (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:108:14)
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:97:9
gyp ERR! stack at ChildProcess.exithandler (child_process.js:735:7)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at maybeClose (child_process.js:1008:16)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1080:5)
gyp ERR! System Linux 3.16.7.8-1-MANJARO
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" >"configure" "build" "install"
gyp ERR! cwd /home/laughingman/node_modules/msi-keyboard/node_modules/node-hid
gyp ERR! node -v v0.12.0
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok
npm ERR! Linux 3.16.7.8-1-MANJARO
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "msi-keyboard"
npm ERR! node v0.12.0
npm ERR! npm v2.7.1
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: sh install.sh
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'sh install.sh'.
npm ERR! This is most likely a problem with the node-hid package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! sh install.sh
npm ERR! You can get their info via:
npm ERR! npm owner ls node-hid
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/laughingman/npm-debug.log

Doesn’t install on Archlinux

phaazon@illusion ~/msi-keyboard % npm install --python=python2.7
/
> [email protected] preinstall /home/phaazon/msi-keyboard/node_modules/node-hid
> sh get-hidapi.sh

Cloning into 'hidapi'...
remote: Counting objects: 1965, done.
remote: Total 1965 (delta 0), reused 0 (delta 0), pack-reused 1965
Receiving objects: 100% (1965/1965), 2.79 MiB | 939.00 KiB/s, done.
Resolving deltas: 100% (1082/1082), done.
Checking connectivity... done.

> [email protected] install /home/phaazon/msi-keyboard/node_modules/node-hid
> sh install.sh

make: Entering directory '/home/phaazon/msi-keyboard/node_modules/node-hid/build'
  CC(target) Release/obj.target/hidapi/hidapi/libusb/hid.o
../hidapi/libusb/hid.c: In function ‘hid_read_timeout’:
../hidapi/libusb/hid.c:1078:6: warning: variable ‘bytes_read’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
  int bytes_read = -1;
      ^
  AR(target) Release/obj.target/hidapi.a
  COPY Release/hidapi.a
  CXX(target) Release/obj.target/HID/src/HID.o
../src/HID.cc: In member function ‘virtual v8::Handle<v8::Value> JSException::asV8Exception() const’:
../src/HID.cc:50:71: error: ‘New’ is not a member of ‘v8::String’
   virtual Handle<Value> asV8Exception() const { return ThrowException(String::New(message().c_str())); }
                                                                       ^
../src/HID.cc:50:101: error: ‘ThrowException’ was not declared in this scope
   virtual Handle<Value> asV8Exception() const { return ThrowException(String::New(message().c_str())); }
                                                                                                     ^
../src/HID.cc: At global scope:
../src/HID.cc:58:1: error: expected class-name before ‘{’ token
 {
 ^
../src/HID.cc:61:38: error: ‘Arguments’ does not name a type
   static Handle<Value> devices(const Arguments& args);
                                      ^
../src/HID.cc:76:34: error: ‘Arguments’ does not name a type
   static Handle<Value> New(const Arguments& args);
                                  ^
../src/HID.cc:77:35: error: ‘Arguments’ does not name a type
   static Handle<Value> read(const Arguments& args);
                                   ^
../src/HID.cc:78:36: error: ‘Arguments’ does not name a type
   static Handle<Value> write(const Arguments& args);
                                    ^
../src/HID.cc:79:36: error: ‘Arguments’ does not name a type
   static Handle<Value> close(const Arguments& args);
                                    ^
../src/HID.cc:80:45: error: ‘Arguments’ does not name a type
   static Handle<Value> setNonBlocking(const Arguments& args);
                                             ^
../src/HID.cc:81:47: error: ‘Arguments’ does not name a type
   static Handle<Value> getFeatureReport(const Arguments& args);
                                               ^
../src/HID.cc:83:48: error: ‘Arguments’ does not name a type
   static Handle<Value> sendFeatureReport(const Arguments& args);
                                                ^
../src/HID.cc:86:25: error: ‘uv_work_t’ has not been declared
   static void recvAsync(uv_work_t* req);
                         ^
../src/HID.cc:87:29: error: ‘uv_work_t’ has not been declared
   static void recvAsyncDone(uv_work_t* req);
                             ^
../src/HID.cc:177:16: error: variable or field ‘recvAsync’ declared void
 HID::recvAsync(uv_work_t* req)
                ^
../src/HID.cc:177:16: error: ‘uv_work_t’ was not declared in this scope
../src/HID.cc:177:27: error: ‘req’ was not declared in this scope
 HID::recvAsync(uv_work_t* req)
                           ^
In file included from ../src/HID.cc:30:0:
/home/phaazon/.node-gyp/0.12.2/deps/v8/include/v8.h: In instantiation of ‘static void v8::NonCopyablePersistentTraits<T>::Uncompilable() [with O = v8::Object; T = v8::Object]’:
/home/phaazon/.node-gyp/0.12.2/deps/v8/include/v8.h:592:17:   required from ‘static void v8::NonCopyablePersistentTraits<T>::Copy(const v8::Persistent<S, M>&, v8::NonCopyablePersistentTraits<T>::NonCopyablePersistent*) [with S = v8::Object; M = v8::NonCopyablePersistentTraits<v8::Object>; T = v8::Object; v8::NonCopyablePersistentTraits<T>::NonCopyablePersistent = v8::Persistent<v8::Object>]’
/home/phaazon/.node-gyp/0.12.2/deps/v8/include/v8.h:5826:21:   required from ‘void v8::Persistent<T, M>::Copy(const v8::Persistent<S, M>&) [with S = v8::Object; M2 = v8::NonCopyablePersistentTraits<v8::Object>; T = v8::Object; M = v8::NonCopyablePersistentTraits<v8::Object>]’
/home/phaazon/.node-gyp/0.12.2/deps/v8/include/v8.h:657:14:   required from ‘v8::Persistent<T, M>::Persistent(const v8::Persistent<T, M>&) [with T = v8::Object; M = v8::NonCopyablePersistentTraits<v8::Object>]’
../src/HID.cc:94:17:   required from here
/home/phaazon/.node-gyp/0.12.2/deps/v8/include/v8.h:167:37: error: cannot convert ‘v8::Primitive*’ to ‘v8::Object* volatile’ in assignment
     *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
                                     ^
/home/phaazon/.node-gyp/0.12.2/deps/v8/include/v8.h:596:5: note: in expansion of macro ‘TYPE_CHECK’
     TYPE_CHECK(O, Primitive);
     ^
/home/phaazon/.node-gyp/0.12.2/deps/v8/include/v8.h: In instantiation of ‘static void v8::NonCopyablePersistentTraits<T>::Uncompilable() [with O = v8::Object; T = v8::Function]’:
/home/phaazon/.node-gyp/0.12.2/deps/v8/include/v8.h:592:17:   required from ‘static void v8::NonCopyablePersistentTraits<T>::Copy(const v8::Persistent<S, M>&, v8::NonCopyablePersistentTraits<T>::NonCopyablePersistent*) [with S = v8::Function; M = v8::NonCopyablePersistentTraits<v8::Function>; T = v8::Function; v8::NonCopyablePersistentTraits<T>::NonCopyablePersistent = v8::Persistent<v8::Function>]’
/home/phaazon/.node-gyp/0.12.2/deps/v8/include/v8.h:5826:21:   required from ‘void v8::Persistent<T, M>::Copy(const v8::Persistent<S, M>&) [with S = v8::Function; M2 = v8::NonCopyablePersistentTraits<v8::Function>; T = v8::Function; M = v8::NonCopyablePersistentTraits<v8::Function>]’
/home/phaazon/.node-gyp/0.12.2/deps/v8/include/v8.h:657:14:   required from ‘v8::Persistent<T, M>::Persistent(const v8::Persistent<T, M>&) [with T = v8::Function; M = v8::NonCopyablePersistentTraits<v8::Function>]’
../src/HID.cc:94:17:   required from here
/home/phaazon/.node-gyp/0.12.2/deps/v8/include/v8.h:167:37: error: cannot convert ‘v8::Primitive*’ to ‘v8::Object* volatile’ in assignment
     *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
                                     ^
/home/phaazon/.node-gyp/0.12.2/deps/v8/include/v8.h:596:5: note: in expansion of macro ‘TYPE_CHECK’
     TYPE_CHECK(O, Primitive);
     ^
../src/HID.cc: In member function ‘virtual v8::Handle<v8::Value> JSException::asV8Exception() const’:
../src/HID.cc:50:104: warning: control reaches end of non-void function [-Wreturn-type]
   virtual Handle<Value> asV8Exception() const { return ThrowException(String::New(message().c_str())); }
                                                                                                        ^
HID.target.mk:94: recipe for target 'Release/obj.target/HID/src/HID.o' failed
make: *** [Release/obj.target/HID/src/HID.o] Error 1
make: Leaving directory '/home/phaazon/msi-keyboard/node_modules/node-hid/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Linux 3.19.2-1-ARCH
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build" "install"
gyp ERR! cwd /home/phaazon/msi-keyboard/node_modules/node-hid
gyp ERR! node -v v0.12.2
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok 
npm ERR! Linux 3.19.2-1-ARCH
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "--python=python2.7"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.5
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `sh install.sh`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'sh install.sh'.
npm ERR! This is most likely a problem with the node-hid package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     sh install.sh
npm ERR! You can get their info via:
npm ERR!     npm owner ls node-hid
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/phaazon/msi-keyboard/npm-debug.log

Linux Mint 17.3 (ubuntu 14.04) Trusty procedure

I have a chapter in my new book showing a working procedure for Linux Mint 17 users.
I find it ridiculous that links are banned, however, if you want to find the ebook I guess you can search the net for "linux mint 17 full and painless migration for anyone".

The book is free to download at the bottom of the page using the big green link.
A $5 payment is requested for the book.
I own an MSI gt70-2pe.

Power button light

Is there anyway to change the light on the power button of my GS60 4K Pro?

NPM Installation Error

Perhaps this is something I'm doing wrong, but I'm getting an error when running
npm install msi-keyboard

npm http GET https://registry.npmjs.org/msi-keyboard
npm http 200 https://registry.npmjs.org/msi-keyboard
npm http GET https://registry.npmjs.org/msi-keyboard/-/msi-keyboard-0.0.2.tgz
npm http 200 https://registry.npmjs.org/msi-keyboard/-/msi-keyboard-0.0.2.tgz
npm http GET https://registry.npmjs.org/node-hid
npm http 200 https://registry.npmjs.org/node-hid
npm http GET https://registry.npmjs.org/node-hid/-/node-hid-0.3.1.tgz
npm http 200 https://registry.npmjs.org/node-hid/-/node-hid-0.3.1.tgz

> [email protected] preinstall /home/brian/node_modules/msi-keyboard/node_modules    /node-hid
> sh get-hidapi.sh

get-hidapi.sh: 8: get-hidapi.sh: git: not found
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm ERR! weird error 127
npm ERR! not ok code 0

What would be the reason for this? Do I need to set some kind of configuration for NPM?

Linux Mint 17 KDE
MSI GT60-022
NPM version 1.3.10

Thanks, and I hope I get to try this out. It seems like a really useful project.

newest code not working

on my msi gt70-2pe laptop:

in the examples folder the color.js script no longer works.
I used to get a rainbow colored solid keyboard.
Now I get lightblue single color.
I recovered color.js from a backup. The code is different. see below.
The older color.js does not work anymore.

I normally login to my desktop and run "sudo nodejs color.js". It is important to me to see in the dark.

Breathe and wave still work (newest copies).

I also use a custom script called off.js that sets all 3 colors to black.
It now does nothing.

If I figure it out I will close the issue.


the old color.js

var keyboard = require('../')();

keyboard.color('left', {
color: 'red',
intensity: 'high'
});
keyboard.color('middle', {
color: 'green',
intensity: 'high'
});
keyboard.color('right', {
color: 'blue',
intensity: 'high'
});

the new color.js

var keyboard = require('../')();

keyboard.color('left', {
color: 'rgba(200, 0, 0)',
intensity: 'high'
});
keyboard.color('middle', {
color: 'green',
intensity: 'high'
});
keyboard.color('right', {
color: '#4654BD',
intensity: 'high'
});

Linux Mint 17.1 64bit instructions

linux steel engine keyboard

Problem: You own a MSI gaming laptop. You would like to have the Steel Series Keyboard light up with those pretty rainbow colors and breathe and do the wave or just glow.

The following is lengthy but so simple a child could do it. I put in many hours piecing together various bits of javascript code from different places to make this all happen as well as spending many hours into the night writing and testing my documentation for Linux Mint 17.1 64bit.

I own a MSI GT70 2PE. My usb keyboard shows up as such:

lsub
Bus 003 Device 003: ID 1770:ff00

If you see something different then I am not at a point to help you.
You'd have to modify the javacode and no guarantee this will work.
Many report this as working on several MSI laptops.

ok, here we go. grab some soda and chips, your in for a ride:

MSI Steel engine keyboard javascript commands for Linux

Here are the websites I am used for reference in case it won't work for you.

http://forum.techinferno.com/msi/5269-msi-led-controller-linux-windows-mac-|-msi-klm-alternative-2.html

https://www.npmjs.com/package/node-hid

#1

steps:

enter your home folder

cd ~

become root

sudo bash

do the following. just cut and paste each step in a terminal...

apt-get install libusb-dev libusb-1.0-0-dev
apt-get install nodejs npm
git clone https://github.com/wearefractal/msi-keyboard
git clone https://github.com/hanshuebner/node-hid
cd node-hid; npm install -g
cd ~
cd msi-keyboard; npm install --g

create the following breathe.js file and put it anywhere you want to....paste in the really huge javascript code provided below that says it is for breathe and wave...

sudo vi breathe.js

now run the javascript...

sudo nodejs breathe.js

your keyboard will breathe....

make a copy of this script to do the wave effect..

sudo cp breathe.js wave.js

In order to make the keyboard do a wave effect modify the wave.js file slightly by

commenting out (// = comment out) the breathe(1, 2, 3, 3, 1); line and uncomment the wave(1, 2, 3, 3, 1); line...

both of these lines are at the very top of the script.

sudo vi wave.js

now do the wave

sudo nodejs wave.js

Take the following 4 lines of javascript code and save it as rainbow.js

This will just make the keyboard light up with red/green/blue without doing any effects.

sudo vi rainbow.js

var keyboard = require('/usr/local/lib/node_modules/msi-keyboard');
keyboard.color('left',{color: 'red', intensity: 'med'});
keyboard.color('middle',{color: 'blue', intensity: 'med'});
keyboard.color('right',{color: 'green', intensity: 'med'});

light her up...

sudo nodejs rainbow.js

if you get a usb error such as 'vendor id #xxxx and product is# not found' then you forgot to use sudo. usb access needs root privileges.

-----------------------------------------------------------------------------------------------------

The following is the really huge javascript code mentioned above to make your keyboard BREATHE or WAVE.

It begins with the 'var' statement. Do not paste in this boxed section:

-----------------------------------------------------------------------------------------------------

var keyboard = require('/usr/local/lib/node_modules/msi-keyboard');

// the breathe line
breathe(1, 2, 3, 3, 1); // COLOR1, COLOR2, COLOR3, PERIOD, LEVEL

// the wave line
//wave(1, 2, 3, 3, 1);

// possible values:
// colors: 0-8
// period: the unit might be seconds?
// level: 0-3

function disable() {
commit(0);
}

function wave(color1, color2, color3, period, level) {
// Convert colors to RGB
color1RGB = getRGB(color1);
color2RGB = getRGB(color2);
color3RGB = getRGB(color3);

// Create three new "speed colors"
var speedColor1 = { r:0, g:0, b:0 };
var speedColor2 = { r:0, g:0, b:0 };
var speedColor3 = { r:0, g:0, b:0 };

speedColor1.r = computeRampSpeed(color1RGB.r, 0, period);
speedColor1.g = computeRampSpeed(color1RGB.g, 0, period);
speedColor1.b = computeRampSpeed(color1RGB.b, 0, period);

speedColor2.r = computeRampSpeed(color2RGB.r, 0, period);
speedColor2.g = computeRampSpeed(color2RGB.g, 0, period);
speedColor2.b = computeRampSpeed(color2RGB.b, 0, period);

speedColor3.r = computeRampSpeed(color3RGB.r, 0, period);
speedColor3.g = computeRampSpeed(color3RGB.g, 0, period);
speedColor3.b = computeRampSpeed(color3RGB.b, 0, period);

// Send data
sendActiveArea(0x43, 1, color1, level, 0);
sendActiveArea(0x43, 2, 0, level, 0);
sendActiveArea(0x43, 3, speedColor1.r, speedColor1.g, speedColor1.b);

sendActiveArea(0x43, 4, color2, level, 0);
sendActiveArea(0x43, 5, 0, level, 0);
sendActiveArea(0x43, 6, speedColor2.r, speedColor2.g, speedColor2.b);

sendActiveArea(0x43, 7, color3, level, 0);
sendActiveArea(0x43, 8, 0, level, 0);
sendActiveArea(0x43, 9, speedColor3.r, speedColor3.g, speedColor3.b);

commit(5);

}

function breathe(color1, color2, color3, period, level) {
// Convert colors to RGB
color1RGB = getRGB(color1);
color2RGB = getRGB(color2);
color3RGB = getRGB(color3);

// Create three new "speed colors"
var speedColor1 = { r:0, g:0, b:0 };
var speedColor2 = { r:0, g:0, b:0 };
var speedColor3 = { r:0, g:0, b:0 };

speedColor1.r = computeRampSpeed(color1RGB.r, 0, period);
speedColor1.g = computeRampSpeed(color1RGB.g, 0, period);
speedColor1.b = computeRampSpeed(color1RGB.b, 0, period);

speedColor2.r = computeRampSpeed(color2RGB.r, 0, period);
speedColor2.g = computeRampSpeed(color2RGB.g, 0, period);
speedColor2.b = computeRampSpeed(color2RGB.b, 0, period);

speedColor3.r = computeRampSpeed(color3RGB.r, 0, period);
speedColor3.g = computeRampSpeed(color3RGB.g, 0, period);
speedColor3.b = computeRampSpeed(color3RGB.b, 0, period);

// Send data
sendActiveArea(0x43, 1, color1, level, 0);
sendActiveArea(0x43, 2, 0, level, 0);
sendActiveArea(0x43, 3, speedColor1.r, speedColor1.g, speedColor1.b);

sendActiveArea(0x43, 4, color2, level, 0);
sendActiveArea(0x43, 5, 0, level, 0);
sendActiveArea(0x43, 6, speedColor2.r, speedColor2.g, speedColor2.b);

sendActiveArea(0x43, 7, color3, level, 0);
sendActiveArea(0x43, 8, 0, level, 0);
sendActiveArea(0x43, 9, speedColor3.r, speedColor3.g, speedColor3.b);

commit(3);

}

// The rest are help functions

function sendActiveArea(modeValue, area, color, level, blue) {
var data = new Buffer(8);

data[0] = 0x01;
data[1] = 0x02;
data[2] = modeValue;
data[3] = area;
data[4] = color;
data[5] = level;
data[6] = blue;
data[7] = 0xec;

keyboard.sendFeatureReport(data);

}

function getRGB(color) {
var rgb = {r:0, g:0, b:0};

if (color == 0) {       // BLACK
    rgb.r = 0;
    rgb.g = 0;
    rgb.b = 0;
} else if (color == 1) {    // RED
    rgb.r = 255;
    rgb.g = 0;
    rgb.b = 0;
} else if (color == 2) {    // ORANGE
    rgb.r = 187;
    rgb.g = 112;
    rgb.b = 0;
} else if (color == 3) {    // YELLOW
    rgb.r = 238;
    rgb.g = 238;
    rgb.b = 0;
} else if (color == 4) {    // GREEN
    rgb.r = 176;
    rgb.g = 255;
    rgb.b = 0;
} else if (color == 5) {    // SKY
    rgb.r = 0;
    rgb.g = 255;
    rgb.b = 255;
} else if (color == 6) {    // BLUE
    rgb.r = 0;
    rgb.g = 0;
    rgb.b = 255;
} else if (color == 7) {    // PURPLE
    rgb.r = 48;
    rgb.g = 0;
    rgb.b = 255;
} else if (color == 8) {    // WHITE
    rgb.r = 176;
    rgb.g = 255;
    rgb.b = 176;
}

return rgb;

}

function computeRampSpeed(leftColor, rightColor, period) {
if (leftColor - rightColor == 0) {
return 0;
}

return Math.ceil((period * 250) / Math.abs(leftColor - rightColor));

}

function commit(mode) {
var data = new Buffer(8);

data[0] = 0x01;
data[1] = 0x02;
data[2] = 0x41;
data[3] = mode;
data[4] = 0x00;
data[5] = 0x00;
data[6] = 0x00;
data[7] = 0xec;

keyboard.sendFeatureReport(data);

}

Could not send feature report to device

Hello.

I am using the CLI version installed through npm. It has a dependency on this library, which I was using in the past (as standalone) with great success.

I recently had to update my node version for work and I'm now using 5.8.0

Unfortunately it has stopped working and when I try "sudo msikeyboard -c green" I get the following error:

/usr/local/lib/node_modules/msi-keyboard-cli/node_modules/msi-keyboard/lib/setColor.js:24
keyboard.sendFeatureReport(activate);
^

Error: could not send feature report to device
at Error (native)
at module.exports (/usr/local/lib/node_modules/msi-keyboard-cli/node_modules/msi-keyboard/lib/setColor.js:24:11)
at HID.board.color (/usr/local/lib/node_modules/msi-keyboard-cli/node_modules/msi-keyboard/lib/findKeyboard.js:12:3)
at /usr/local/lib/node_modules/msi-keyboard-cli/msi-keyboard-CLI.js:348:18
at FSReqWrap.cb as oncomplete

msi gk 701 and othre keyboards

Does this code work with the other msi rgb keyboards?
gk-701 and interceptor ds4200?
I want to know before I spend $150 on one.

Any specific npm/node version on debian?

Someone got it working on debian wheezy?

I have tried it on arch without any issues, but on debian wheezy i have some trouble to install it.

someone got it working there?

MSI GT72 Keyboard Regions

Hello.

First of all I would like to thank you for all the effort you've put into this. It's super useful and works brilliantly!

One issue (which isn't really your fault, as this is probably something new), is that the new GT72 notebook has some extra regions that being lit by the same engine. It's a rectangle around the touchpad and 2 led strips on the side of the laptop casing.

I would imagine it would be easy to add 2 more regions in your code for these 2 new areas. Please let me know how I can be of any help with this.

EDIT: I tried adding regions 4 and 5 in constants.js but unfortunately that did not work :(
I should also mention that these areas do light up as 'red' which I believe is the default. It would be nice however if I could set them to match the keyboard. I don't really like my keyboard to look like a rainbow so I've settled for everything red for now.

Regards,
Dimitris

`off` should be an intensity option (not a color)

I have a MSI GS60 and it has Fn keys that allow you to change the intensity of the keyboard directly to the hardware.

So I had a startup script that set the whole keyboard to green, med. Then the Fn keys allowed me to turn the lights off when I didn't need them. (So since the Fn key changes the intensity and it can turn it off, the intensity option should be able to do this too.

Now comes the issue: I wanted the lights to be off on startup, allowing me to turn them on using the Fn keys when I needed them. The only way to do this currently is by setting the color to off (and the intensity to whatever). However, when I use the Fn keys then, the light will stay of. (This is actually logical, since it changes the intensity, but the color is set to off.)

So basically, off needs to be moved from color to intensity and I think it should be possible.

Not in AUR

Someone should add this to the AUR for easy installation.

Control additional regions for GT72 and (possibly?) newer models

On the GT 72 and newer models, there's a new set of regions that can be colored that weren't available on previous models, resulting on a lot of lights off using the current implementation. I made a way to work with all of them and did some changes to code and this is a continuation from the discussion on #43 . The full commit can be checked out on my forked project here JuanCAlpizar@0d7d07a.

Additional regions can be added to the current array with the proper mapping, like this:

"regions": {
	"left": 1,
	"middle": 2,
	"right": 3,
	"logo": 4,
	"front-right-panel": 5,
	"front-left-panel": 6,
	"trackpad": 7
}

After that I made some additional changes, but those are merely suggestions. First I completely halted the execution if no proper regions are specified for breathe and wave modes like this:

if (typeof regions === 'undefined'){ // if no regions are specified at all, stop the process
	console.log('Error: no regions to work have been specified');
	return false;
}

Then I changed how the default object is filled if a default color is the only thing specified on the region parameter.

if (typeof regions !== 'object'){
	var default_color = regions;
	regions = constants.regions;
	for (var region_name in constants.regions){
		regions[region_name] = default_color;
	}
}

Finally I slightly restructured the cycle to apply colors and mode to regions, basically because there's no need of an array inside an array to determinate the color and region to color and there's no need to parse the index in every iteration. This shouldn't affect execution time to be noticeable, but sometimes I'm an optimization freak :p every region has 3 different layers: one for the foreground color, one for the background color and one for the execution time of that region, making a total of 21 layers. I changed some variable names just to make it easier to read and understand in case any future developer wants to modify and contribute in the future.

var region_layers = {
	'foreground_color_layer': 0,
	'background_color_layer': 0,
	'execution_period_layer': 0
};
var Def = null;
for (var region_to_color in regions){
	if (typeof regions[region_to_color] !== 'undefined'){
		Def = getSettingsForRegion(regions[region_to_color], region_to_color);
		sendData (keyboard, region_layers.foreground_color_layer + 1, Def.primary.color, Def.primary.level, 0);
		sendData (keyboard, region_layers.background_color_layer + 2, Def.secondary.color, Def.secondary.level,
		sendData (keyboard, region_layers.execution_period_layer + 3, period, period, period);
	}else{
		sendData (keyboard, region_layers.foreground_color_layer + 1, {redScale: 0, greenScale: 0, blueScale: 0}, 0, 0);
		sendData (keyboard, region_layers.background_color_layer + 2, {redScale: 0, greenScale: 0, blueScale: 0}, 0, 0);
		sendData (keyboard, region_layers.execution_period_layer + 3, period, period, period);
	}
	
	region_layers.foreground_color_layer += 3;
	region_layers.background_color_layer += 3;
	region_layers.execution_period_layer += 3;
	
}

Please let me know if there's a way we can merge this into your project, and thanks so much for making the hard work possible! 👍

Feature Request: Change key color on keypress

I'd love to see the ability to change specific key's color on keypress. A couple examples of this would be for numlock, scroll lock, caps lock, etc.

I would write the hook to execute a particular command on keypress myself, but at the moment there isn't a command to change a specific key's color (so far as I'm aware).

Error: could not send feature report to device

Hi there,

Trying msi-keyboard on a fresh (brand new GS60 2PL) Funtoo install got me following stack trace:
.../msi-keyboard/examples $ node sample.js
.../msi-keyboard/lib/setColor.js:24
keyboard.sendFeatureReport(activate);
^

Error: could not send feature report to device
at Error (native)
at module.exports (.../msi-keyboard/lib/setColor.js:24:11)
at HID.board.color (.../msi-keyboard/lib/findKeyboard.js:12:3)
at Object. (.../msi-keyboard/examples/sample.js:3:10)
at Module._compile (module.js:434:26)
at Object.Module._extensions..js (module.js:452:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:475:10)
at startup (node.js:117:18)

Currently using nodejs-4.1.1 & libusb-1.0.19, is there a dependency I missed?

new code breaks msi keyboard

I own an MSI-GT70-2PE laptop.

Here is the code I use to compile for linux mint 17 (ubuntu 14.04):

sudo apt-get install git libusb-dev libusb-1.0-0-dev nodejs npm build-essential --install-recommends
sudo ln -s /usr/bin/nodejs /usr/bin/node
git clone https://github.com/wearefractal/msi-keyboard
git clone https://github.com/hanshuebner/node-hid
cd ~/node-hid
git clone https://github.com/signal11/hidapi.git
cd ~/node-hid; sudo npm install -g
cd ~/msi-keyboard; sudo npm install --g

Until recently it worked. Then I reinstalled using the latest github code and it broke.
Some sort of change to the code has caused it to quit working.
I had a copy of the old github code and recovered it and it compiled and worked fine.
Thank God for backups.

I am now upgraded to Mint 18 (ubuntu 16.04):

Here is the error in Mint 18 with the old github code that works in Mint 17:
**>nodejs rainbow.js
/usr/local/lib/node_modules/msi-keyboard/node_modules/node-hid/nodehid.js:28
this._raw = new (Function.prototype.bind.apply(binding.HID,
^

Error: cannot open device with vendor id 0x1770 and product id 0xff00
at Error (native)
at new HID (/usr/local/lib/node_modules/msi-keyboard/node_modules/node-hid/nodehid.js:28:14)
at module.exports (/usr/local/lib/node_modules/msi-keyboard/lib/findKeyboard.js:7:14)
at Object. (/usr/local/lib/node_modules/msi-keyboard/index.js:3:18)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)**

Here is the error in Mint 18 with the new github code:
**>nodejs rainbow.js
/home/dad/rainbow.js:2
keyboard.color('left',{color: 'red', intensity: 'med'});
^

TypeError: keyboard.color is not a function
at Object. (/home/dad/rainbow.js:2:10)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Function.Module.runMain (module.js:442:10)
at startup (node.js:136:18)
at node.js:966:3**

All help appreciated.

If you need more info just ask.

rainbow.js.zip

Install error

This may be an npm issue, but i'm not sure.

Getting the following error when installing:

$ npm install msi-keyboard
npm WARN package.json led-manager@ No description
npm WARN package.json led-manager@ No repository field.
npm WARN package.json led-manager@ No README data
|

[email protected] preinstall /home/schindler/Downloads/msi-klm/node_modules/msi-keyboard/node_modules/node-hid
sh get-hidapi.sh

Cloning into 'hidapi'...
remote: Counting objects: 1965, done.
remote: Total 1965 (delta 0), reused 0 (delta 0), pack-reused 1965
Receiving objects: 100% (1965/1965), 2.79 MiB | 1.06 MiB/s, done.
Resolving deltas: 100% (1082/1082), done.
Checking connectivity... done.

[email protected] install /home/schindler/Downloads/msi-klm/node_modules/msi-keyboard/node_modules/node-hid
sh install.sh

make: Entering directory '/home/schindler/Downloads/msi-klm/node_modules/msi-keyboard/node_modules/node-hid/build'
CC(target) Release/obj.target/hidapi/hidapi/libusb/hid.o
../hidapi/libusb/hid.c: In function ‘hid_read_timeout’:
../hidapi/libusb/hid.c:1078:6: warning: variable ‘bytes_read’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
int bytes_read = -1;
^
AR(target) Release/obj.target/hidapi.a
COPY Release/hidapi.a
CXX(target) Release/obj.target/HID/src/HID.o
../src/HID.cc: In member function ‘virtual v8::Handlev8::Value JSException::asV8Exception() const’:
../src/HID.cc:50:71: error: ‘New’ is not a member of ‘v8::String’
virtual Handle asV8Exception() const { return ThrowException(String::New(message().c_str())); }
^
../src/HID.cc:50:101: error: ‘ThrowException’ was not declared in this scope
virtual Handle asV8Exception() const { return ThrowException(String::New(message().c_str())); }
^
../src/HID.cc: At global scope:
../src/HID.cc:58:1: error: expected class-name before ‘{’ token
{
^
../src/HID.cc:61:38: error: ‘Arguments’ does not name a type
static Handle devices(const Arguments& args);
^
../src/HID.cc:76:34: error: ‘Arguments’ does not name a type
static Handle New(const Arguments& args);
^
../src/HID.cc:77:35: error: ‘Arguments’ does not name a type
static Handle read(const Arguments& args);
^
../src/HID.cc:78:36: error: ‘Arguments’ does not name a type
static Handle write(const Arguments& args);
^
../src/HID.cc:79:36: error: ‘Arguments’ does not name a type
static Handle close(const Arguments& args);
^
../src/HID.cc:80:45: error: ‘Arguments’ does not name a type
static Handle setNonBlocking(const Arguments& args);
^
../src/HID.cc:81:47: error: ‘Arguments’ does not name a type
static Handle getFeatureReport(const Arguments& args);
^
../src/HID.cc:83:48: error: ‘Arguments’ does not name a type
static Handle sendFeatureReport(const Arguments& args);
^
../src/HID.cc:86:25: error: ‘uv_work_t’ has not been declared
static void recvAsync(uv_work_t* req);
^
../src/HID.cc:87:29: error: ‘uv_work_t’ has not been declared
static void recvAsyncDone(uv_work_t* req);
^
../src/HID.cc:177:16: error: variable or field ‘recvAsync’ declared void
HID::recvAsync(uv_work_t* req)
^
../src/HID.cc:177:16: error: ‘uv_work_t’ was not declared in this scope
../src/HID.cc:177:27: error: ‘req’ was not declared in this scope
HID::recvAsync(uv_work_t* req)
^
In file included from ../src/HID.cc:30:0:
/home/schindler/.node-gyp/0.12.2/deps/v8/include/v8.h: In instantiation of ‘static void v8::NonCopyablePersistentTraits::Uncompilable() [with O = v8::Object; T = v8::Object]’:
/home/schindler/.node-gyp/0.12.2/deps/v8/include/v8.h:592:17: required from ‘static void v8::NonCopyablePersistentTraits::Copy(const v8::Persistent<S, M>&, v8::NonCopyablePersistentTraits::NonCopyablePersistent_) [with S = v8::Object; M = v8::NonCopyablePersistentTraitsv8::Object; T = v8::Object; v8::NonCopyablePersistentTraits::NonCopyablePersistent = v8::Persistentv8::Object]’
/home/schindler/.node-gyp/0.12.2/deps/v8/include/v8.h:5826:21: required from ‘void v8::Persistent<T, M>::Copy(const v8::Persistent<S, M>&) [with S = v8::Object; M2 = v8::NonCopyablePersistentTraitsv8::Object; T = v8::Object; M = v8::NonCopyablePersistentTraitsv8::Object]’
/home/schindler/.node-gyp/0.12.2/deps/v8/include/v8.h:657:14: required from ‘v8::Persistent<T, M>::Persistent(const v8::Persistent<T, M>&) [with T = v8::Object; M = v8::NonCopyablePersistentTraitsv8::Object]’
../src/HID.cc:94:17: required from here
/home/schindler/.node-gyp/0.12.2/deps/v8/include/v8.h:167:37: error: cannot convert ‘v8::Primitive_’ to ‘v8::Object* volatile’ in assignment
(static_cast<T volatile_>(0)) = static_cast<S_>(0);
^
/home/schindler/.node-gyp/0.12.2/deps/v8/include/v8.h:596:5: note: in expansion of macro ‘TYPE_CHECK’
TYPE_CHECK(O, Primitive);
^
/home/schindler/.node-gyp/0.12.2/deps/v8/include/v8.h: In instantiation of ‘static void v8::NonCopyablePersistentTraits::Uncompilable() [with O = v8::Object; T = v8::Function]’:
/home/schindler/.node-gyp/0.12.2/deps/v8/include/v8.h:592:17: required from ‘static void v8::NonCopyablePersistentTraits::Copy(const v8::Persistent<S, M>&, v8::NonCopyablePersistentTraits::NonCopyablePersistent_) [with S = v8::Function; M = v8::NonCopyablePersistentTraitsv8::Function; T = v8::Function; v8::NonCopyablePersistentTraits::NonCopyablePersistent = v8::Persistentv8::Function]’
/home/schindler/.node-gyp/0.12.2/deps/v8/include/v8.h:5826:21: required from ‘void v8::Persistent<T, M>::Copy(const v8::Persistent<S, M>&) [with S = v8::Function; M2 = v8::NonCopyablePersistentTraitsv8::Function; T = v8::Function; M = v8::NonCopyablePersistentTraitsv8::Function]’
/home/schindler/.node-gyp/0.12.2/deps/v8/include/v8.h:657:14: required from ‘v8::Persistent<T, M>::Persistent(const v8::Persistent<T, M>&) [with T = v8::Function; M = v8::NonCopyablePersistentTraitsv8::Function]’
../src/HID.cc:94:17: required from here
/home/schindler/.node-gyp/0.12.2/deps/v8/include/v8.h:167:37: error: cannot convert ‘v8::Primitive_’ to ‘v8::Object* volatile’ in assignment
(static_cast<T volatile_>(0)) = static_cast<S_>(0);
^
/home/schindler/.node-gyp/0.12.2/deps/v8/include/v8.h:596:5: note: in expansion of macro ‘TYPE_CHECK’
TYPE_CHECK(O, Primitive);
^
../src/HID.cc: In member function ‘virtual v8::Handlev8::Value JSException::asV8Exception() const’:
../src/HID.cc:50:104: warning: control reaches end of non-void function [-Wreturn-type]
virtual Handle asV8Exception() const { return ThrowException(String::New(message().c_str())); }
^
HID.target.mk:94: recipe for target 'Release/obj.target/HID/src/HID.o' failed
make: *** [Release/obj.target/HID/src/HID.o] Error 1
make: Leaving directory '/home/schindler/Downloads/msi-klm/node_modules/msi-keyboard/node_modules/node-hid/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Linux 3.19.2-1-ARCH
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build" "install"
gyp ERR! cwd /home/schindler/Downloads/msi-klm/node_modules/msi-keyboard/node_modules/node-hid
gyp ERR! node -v v0.12.2
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok
npm ERR! Linux 3.19.2-1-ARCH
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "msi-keyboard"
npm ERR! node v0.12.2
npm ERR! npm v2.7.5
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: sh install.sh
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'sh install.sh'.
npm ERR! This is most likely a problem with the node-hid package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! sh install.sh
npm ERR! You can get their info via:
npm ERR! npm owner ls node-hid
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/schindler/Downloads/msi-klm/npm-debug.log

Here is /home/schindler/Downloads/msi-klm/npm-debug.log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'install', 'msi-keyboard' ]
2 info using [email protected]
3 info using [email protected]
4 warn package.json led-manager@ No description
5 warn package.json led-manager@ No repository field.
6 warn package.json led-manager@ No README data
7 silly cache add args [ 'msi-keyboard@', null ]
8 verbose cache add spec msi-keyboard@

9 silly cache add parsed spec { raw: 'msi-keyboard@',
9 silly cache add scope: null,
9 silly cache add name: 'msi-keyboard',
9 silly cache add rawSpec: '
',
9 silly cache add spec: '',
9 silly cache add type: 'range' }
10 verbose addNamed msi-keyboard@

11 silly addNamed semver.valid null
12 silly addNamed semver.validRange *
13 silly addNameRange { name: 'msi-keyboard', range: '', hasData: false }
14 silly mapToRegistry name msi-keyboard
15 silly mapToRegistry using default registry
16 silly mapToRegistry registry https://registry.npmjs.org/
17 silly mapToRegistry uri https://registry.npmjs.org/msi-keyboard
18 verbose addNameRange registry:https://registry.npmjs.org/msi-keyboard not in flight; fetching
19 verbose request uri https://registry.npmjs.org/msi-keyboard
20 verbose request no auth needed
21 info attempt registry request try #1 at 15:18:38
22 verbose request id 3a3db6a3a3c05224
23 verbose etag "5IIDKGSG98WCY8ASOXNKDULXH"
24 http request GET https://registry.npmjs.org/msi-keyboard
25 http 304 https://registry.npmjs.org/msi-keyboard
26 silly get cb [ 304,
26 silly get { date: 'Sun, 05 Apr 2015 19:18:38 GMT',
26 silly get server: 'Apache',
26 silly get via: '1.1 varnish',
26 silly get 'last-modified': 'Sun, 05 Apr 2015 19:18:39 GMT',
26 silly get 'cache-control': 'max-age=60',
26 silly get etag: '"5IIDKGSG98WCY8ASOXNKDULXH"',
26 silly get age: '0',
26 silly get 'x-served-by': 'cache-jfk1022-JFK',
26 silly get 'x-cache': 'MISS',
26 silly get 'x-cache-hits': '0',
26 silly get 'x-timer': 'S1428261518.815458,VS0,VE350',
26 silly get vary: 'Accept',
26 silly get 'content-length': '0',
26 silly get 'keep-alive': 'timeout=10, max=50',
26 silly get connection: 'Keep-Alive' } ]
27 verbose etag https://registry.npmjs.org/msi-keyboard from cache
28 verbose get saving msi-keyboard to /home/schindler/.npm/registry.npmjs.org/msi-keyboard/.cache.json
29 silly addNameRange number 2 { name: 'msi-keyboard', range: '
', hasData: true }
30 silly addNameRange versions [ 'msi-keyboard', [ '0.0.1', '0.0.2' ] ]
31 verbose addNamed [email protected]
32 silly addNamed semver.valid 0.0.2
33 silly addNamed semver.validRange 0.0.2
34 silly cache afterAdd [email protected]
35 verbose afterAdd /home/schindler/.npm/msi-keyboard/0.0.2/package/package.json not in flight; writing
36 verbose afterAdd /home/schindler/.npm/msi-keyboard/0.0.2/package/package.json written
37 silly install resolved [ { name: 'msi-keyboard',
37 silly install resolved description: 'MSI Keyboard LED Controller',
37 silly install resolved version: '0.0.2',
37 silly install resolved homepage: 'http://github.com/wearefractal/msi-keyboard',
37 silly install resolved repository:
37 silly install resolved { type: 'git',
37 silly install resolved url: 'git://github.com/wearefractal/msi-keyboard.git' },
37 silly install resolved author:
37 silly install resolved { name: 'Fractal',
37 silly install resolved email: '[email protected]',
37 silly install resolved url: 'http://wearefractal.com/' },
37 silly install resolved main: './index.js',
37 silly install resolved dependencies: { 'node-hid': '' },
37 silly install resolved devDependencies: { mocha: '
', should: '' },
37 silly install resolved scripts: { test: 'mocha' },
37 silly install resolved engines: { node: '>= 0.4.0' },
37 silly install resolved licenses: [ [Object] ],
37 silly install resolved readme: 'Build Status\n\nNPM version\n\n## Information\n\n

\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Packagemsi-keyboard
DescriptionMSI Keyboard LED Controller
HardwareMSI GE, GT Steelseries Keyboard
Node Version>= 0.4
\n\nkeyboard\n\n## Usage\n\njavascript\n// require the LED module\nvar keyboard = require(\'msi-keyboard\');\n\n// Set left region to high intensity, color red\nkeyboard.color(\'left\', {\n\tcolor: \'red\',\n\tintensity: \'high\'\n});\n\n// Set middle region to green default high intensity\nkeyboard.color(\'middle\', \'green\');\n\n\n// Set right region to blue with light intensity\nkeyboard.color(\'right\', {\n\tcolor: \'blue\',\n\tintensity: \'light\',\n});\n\n\n// Hardware modes\n// Setting .color() will Not affect the hardware defined colors for modes\n\n// Set Hardware mode to breath\nkeyboard.mode(\'breathe\');\n\n\n// Blinking\n// Set the keyboard.color() Before calling .blink()\n// Refer to examples/blinkMulti.js\n\n// Blink all the keyboard LEDs to 750ms\nkeyboard.blink(750);\n\n\n// Blink Only left and right regions at 750ms\nkeyboard.blink([\'left\',\'right\'], 750);\n\n\n// Use the default blink, time: 1000ms\nkeyboard.blink();\n\n\n// Stop the blink after 5000ms\nsetTimeout(keyboard.stopBlink, 5000);\n\n\n\n\n\n## Colors\nColors are set\n\n\n\n\n## Examples\n\nYou can view more examples in the example folder.\n\n## LICENSE\n\n(MIT License)\n\nCopyright (c) 2013 Steve Lacy | Fractal [email protected]\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n"Software"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n',
37 silly install resolved readmeFilename: 'README.md',
37 silly install resolved bugs: { url: 'https://github.com/wearefractal/msi-keyboard/issues' },
37 silly install resolved id: '[email protected]',
37 silly install resolved dist:
37 silly install resolved { shasum: '07698074776f9188714fa5c62916dc9a968e578f',
37 silly install resolved tarball: 'http://registry.npmjs.org/msi-keyboard/-/msi-keyboard-0.0.2.tgz' },
37 silly install resolved from: 'msi-keyboard@',
37 silly install resolved npmVersion: '1.3.14',
37 silly install resolved npmUser: { name: 'fractal', email: '[email protected]' },
37 silly install resolved maintainers: [ [Object] ],
37 silly install resolved directories: {},
37 silly install resolved shasum: '07698074776f9188714fa5c62916dc9a968e578f',
37 silly install resolved resolved: 'https://registry.npmjs.org/msi-keyboard/-/msi-keyboard-0.0.2.tgz' } ]
38 info install [email protected] into /home/schindler/Downloads/msi-klm
39 info installOne [email protected]
40 verbose installOne of msi-keyboard to /home/schindler/Downloads/msi-klm not in flight; installing
41 verbose lock using /home/schindler/.npm/locks/msi-keyboard-325b25a69441a5ee.lock for /home/schindler/Downloads/msi-klm/node_modules/msi-keyboard
42 silly install write writing msi-keyboard 0.0.2 to /home/schindler/Downloads/msi-klm/node_modules/msi-keyboard
43 silly cache addNamed cb [email protected]
44 verbose unbuild node_modules/msi-keyboard
45 silly gentlyRm /home/schindler/Downloads/msi-klm/node_modules/msi-keyboard is being purged from base /home/schindler/Downloads/msi-klm
46 verbose gentlyRm don't care about contents; nuking /home/schindler/Downloads/msi-klm/node_modules/msi-keyboard
47 verbose tar unpack /home/schindler/.npm/msi-keyboard/0.0.2/package.tgz
48 verbose tar unpacking to /home/schindler/Downloads/msi-klm/node_modules/msi-keyboard
49 silly gentlyRm /home/schindler/Downloads/msi-klm/node_modules/msi-keyboard is being purged
50 verbose gentlyRm don't care about contents; nuking /home/schindler/Downloads/msi-klm/node_modules/msi-keyboard
51 silly gunzTarPerm modes [ '755', '644' ]
52 silly gunzTarPerm extractEntry package.json
53 silly gunzTarPerm extractEntry .npmignore
54 silly gunzTarPerm extractEntry README.md
55 silly gunzTarPerm extractEntry LICENSE
56 silly gunzTarPerm extractEntry index.js
57 silly gunzTarPerm extractEntry .travis.yml
58 silly gunzTarPerm extractEntry examples/blink.js
59 silly gunzTarPerm extractEntry examples/blinkMulti.js
60 silly gunzTarPerm extractEntry examples/breathe.js
61 silly gunzTarPerm extractEntry examples/sample.js
62 silly gunzTarPerm extractEntry examples/wave.js
63 silly gunzTarPerm extractEntry lib/findKeyboard.js
64 silly gunzTarPerm extractEntry lib/setColor.js
65 silly gunzTarPerm extractEntry lib/setMode.js
66 silly gunzTarPerm extractEntry lib/constants.json
67 silly gunzTarPerm extractEntry test/findKeyboard.js
68 silly gunzTarPerm extractEntry test/main.js
69 silly gunzTarPerm extractEntry test/setColor.js
70 info preinstall [email protected]
71 silly prepareForInstallMany adding node-hid@* from msi-keyboard dependencies
72 silly cache add args [ 'node-hid@
', null ]
73 verbose cache add spec node-hid@

74 silly cache add parsed spec { raw: 'node-hid@
',
74 silly cache add scope: null,
74 silly cache add name: 'node-hid',
74 silly cache add rawSpec: '
',
74 silly cache add spec: '
',
74 silly cache add type: 'range' }
75 verbose addNamed node-hid@

76 silly addNamed semver.valid null
77 silly addNamed semver.validRange *
78 silly addNameRange { name: 'node-hid', range: '
', hasData: false }
79 silly mapToRegistry name node-hid
80 silly mapToRegistry using default registry
81 silly mapToRegistry registry https://registry.npmjs.org/
82 silly mapToRegistry uri https://registry.npmjs.org/node-hid
83 verbose addNameRange registry:https://registry.npmjs.org/node-hid not in flight; fetching
84 verbose request uri https://registry.npmjs.org/node-hid
85 verbose request no auth needed
86 info attempt registry request try #1 at 15:18:39
87 verbose etag "4UVN0W5XEWPIWIHTLU6BBN1MC"
88 http request GET https://registry.npmjs.org/node-hid
89 http 304 https://registry.npmjs.org/node-hid
90 silly get cb [ 304,
90 silly get { date: 'Sun, 05 Apr 2015 19:18:39 GMT',
90 silly get server: 'Apache',
90 silly get via: '1.1 varnish',
90 silly get 'last-modified': 'Sun, 05 Apr 2015 19:18:39 GMT',
90 silly get 'cache-control': 'max-age=60',
90 silly get etag: '"4UVN0W5XEWPIWIHTLU6BBN1MC"',
90 silly get age: '0',
90 silly get 'x-served-by': 'cache-jfk1023-JFK',
90 silly get 'x-cache': 'MISS',
90 silly get 'x-cache-hits': '0',
90 silly get 'x-timer': 'S1428261519.701099,VS0,VE76',
90 silly get vary: 'Accept',
90 silly get 'content-length': '0',
90 silly get 'keep-alive': 'timeout=10, max=50',
90 silly get connection: 'Keep-Alive' } ]
91 verbose etag https://registry.npmjs.org/node-hid from cache
92 verbose get saving node-hid to /home/schindler/.npm/registry.npmjs.org/node-hid/.cache.json
93 silly addNameRange number 2 { name: 'node-hid', range: '_', hasData: true }
94 silly addNameRange versions [ 'node-hid',
94 silly addNameRange [ '0.0.13',
94 silly addNameRange '0.0.14',
94 silly addNameRange '0.0.15',
94 silly addNameRange '0.1.0',
94 silly addNameRange '0.1.1',
94 silly addNameRange '0.2.0',
94 silly addNameRange '0.2.1',
94 silly addNameRange '0.2.2',
94 silly addNameRange '0.2.3',
94 silly addNameRange '0.3.1',
94 silly addNameRange '0.3.2' ] ]
95 verbose addNamed [email protected]
96 silly addNamed semver.valid 0.3.2
97 silly addNamed semver.validRange 0.3.2
98 silly cache afterAdd [email protected]
99 verbose afterAdd /home/schindler/.npm/node-hid/0.3.2/package/package.json not in flight; writing
100 verbose afterAdd /home/schindler/.npm/node-hid/0.3.2/package/package.json written
101 silly install resolved [ { name: 'node-hid',
101 silly install resolved description: 'USB HID device access library',
101 silly install resolved version: '0.3.2',
101 silly install resolved author:
101 silly install resolved { name: 'Hans Hübner',
101 silly install resolved email: '[email protected]',
101 silly install resolved url: 'https://github.com/hanshuebner' },
101 silly install resolved contributors: [ [Object] ],
101 silly install resolved repository:
101 silly install resolved { type: 'git',
101 silly install resolved url: 'git://github.com/hanshuebner/node-hid.git' },
101 silly install resolved scripts:
101 silly install resolved { preupdate: 'sh get-hidapi.sh',
101 silly install resolved preinstall: 'sh get-hidapi.sh',
101 silly install resolved install: 'sh install.sh' },
101 silly install resolved main: './index.js',
101 silly install resolved engines: { node: '>=0.8.0' },
101 silly install resolved license: 'MIT/X11',
101 silly install resolved dependencies: {},
101 silly install resolved devDependencies: {},
101 silly install resolved gitHead: 'd9833cef3a4eff6110be3e1de5d8b5c8bb106500',
101 silly install resolved bugs: { url: 'https://github.com/hanshuebner/node-hid/issues' },
101 silly install resolved homepage: 'https://github.com/hanshuebner/node-hid',
101 silly install resolved _id: '[email protected]',
101 silly install resolved _shasum: '2414824b459313d1ca627fabdb4cb7a2506c0478',
101 silly install resolved _from: 'node-hid@*',
101 silly install resolved _npmVersion: '1.4.21',
101 silly install resolved _npmUser: { name: 'hans', email: '[email protected]' },
101 silly install resolved maintainers: [ [Object], [Object], [Object] ],
101 silly install resolved dist:
101 silly install resolved { shasum: '2414824b459313d1ca627fabdb4cb7a2506c0478',
101 silly install resolved tarball: 'http://registry.npmjs.org/node-hid/-/node-hid-0.3.2.tgz' },
101 silly install resolved directories: {},
101 silly install resolved _resolved: 'https://registry.npmjs.org/node-hid/-/node-hid-0.3.2.tgz',
101 silly install resolved readme: 'ERROR: No README data found!' } ]
102 info install [email protected] into /home/schindler/Downloads/msi-klm/node_modules/msi-keyboard
103 info installOne [email protected]
104 verbose installOne of node-hid to /home/schindler/Downloads/msi-klm/node_modules/msi-keyboard not in flight; installing
105 verbose lock using /home/schindler/.npm/_locks/node-hid-ae83e13d8a2ab0cf.lock for /home/schindler/Downloads/msi-klm/node_modules/msi-keyboard/node_modules/node-hid
106 silly install write writing node-hid 0.3.2 to /home/schindler/Downloads/msi-klm/node_modules/msi-keyboard/node_modules/node-hid
107 silly cache addNamed cb [email protected]
108 verbose unbuild node_modules/msi-keyboard/node_modules/node-hid
109 silly gentlyRm /home/schindler/Downloads/msi-klm/node_modules/msi-keyboard/node_modules/node-hid is being purged from base /home/schindler/Downloads/msi-klm
110 verbose gentlyRm don't care about contents; nuking /home/schindler/Downloads/msi-klm/node_modules/msi-keyboard/node_modules/node-hid
111 verbose tar unpack /home/schindler/.npm/node-hid/0.3.2/package.tgz
112 verbose tar unpacking to /home/schindler/Downloads/msi-klm/node_modules/msi-keyboard/node_modules/node-hid
113 silly gentlyRm /home/schindler/Downloads/msi-klm/node_modules/msi-keyboard/node_modules/node-hid is being purged
114 verbose gentlyRm don't care about contents; nuking /home/schindler/Downloads/msi-klm/node_modules/msi-keyboard/node_modules/node-hid
115 silly gunzTarPerm modes [ '755', '644' ]
116 silly gunzTarPerm extractEntry package.json
117 silly gunzTarPerm extractEntry .npmignore
118 silly gunzTarPerm extractEntry README.md
119 silly gunzTarPerm extractEntry index.js
120 silly gunzTarPerm extractEntry binding.gyp
121 silly gunzTarPerm extractEntry get-hidapi.sh
122 silly gunzTarPerm extractEntry install.sh
123 silly gunzTarPerm extractEntry src/.npmignore
124 silly gunzTarPerm extractEntry src/buzzers.js
125 silly gunzTarPerm extractEntry src/powermate.js
126 silly gunzTarPerm extractEntry src/show-devices.js
127 silly gunzTarPerm extractEntry src/test-buzzers.js
128 silly gunzTarPerm extractEntry src/test-powermate.js
129 silly gunzTarPerm extractEntry src/test-ps3.js
130 silly gunzTarPerm extractEntry src/HID.cc
131 silly gunzTarPerm extractEntry src/wscript
132 info preinstall [email protected]
133 verbose unsafe-perm in lifecycle true
134 silly install resolved []
135 verbose about to build /home/schindler/Downloads/msi-klm/node_modules/msi-keyboard/node_modules/node-hid
136 info build /home/schindler/Downloads/msi-klm/node_modules/msi-keyboard/node_modules/node-hid
137 verbose linkStuff [ false,
137 verbose linkStuff false,
137 verbose linkStuff false,
137 verbose linkStuff '/home/schindler/Downloads/msi-klm/node_modules/msi-keyboard/node_modules' ]
138 info linkStuff [email protected]
139 verbose linkBins [email protected]
140 verbose linkMans [email protected]
141 verbose rebuildBundles [email protected]
142 info install [email protected]
143 verbose unsafe-perm in lifecycle true
144 info [email protected] Failed to exec install script
145 verbose unlock done using /home/schindler/.npm/_locks/node-hid-ae83e13d8a2ab0cf.lock for /home/schindler/Downloads/msi-klm/node_modules/msi-keyboard/node_modules/node-hid
146 verbose about to build /home/schindler/Downloads/msi-klm/node_modules/msi-keyboard
147 verbose unlock done using /home/schindler/.npm/_locks/msi-keyboard-325b25a69441a5ee.lock for /home/schindler/Downloads/msi-klm/node_modules/msi-keyboard
148 verbose stack Error: [email protected] install: sh install.sh
148 verbose stack Exit status 1
148 verbose stack at EventEmitter. (/usr/lib/node_modules/npm/lib/utils/lifecycle.js:213:16)
148 verbose stack at EventEmitter.emit (events.js:110:17)
148 verbose stack at ChildProcess. (/usr/lib/node_modules/npm/lib/utils/spawn.js:14:12)
148 verbose stack at ChildProcess.emit (events.js:110:17)
148 verbose stack at maybeClose (child_process.js:1015:16)
148 verbose stack at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
149 verbose pkgid [email protected]
150 verbose cwd /home/schindler/Downloads/msi-klm
151 error Linux 3.19.2-1-ARCH
152 error argv "/usr/bin/node" "/usr/bin/npm" "install" "msi-keyboard"
153 error node v0.12.2
154 error npm v2.7.5
155 error code ELIFECYCLE
156 error [email protected] install: sh install.sh
156 error Exit status 1
157 error Failed at the [email protected] install script 'sh install.sh'.
157 error This is most likely a problem with the node-hid package,
157 error not with npm itself.
157 error Tell the author that this fails on your system:
157 error sh install.sh
157 error You can get their info via:
157 error npm owner ls node-hid
157 error There is likely additional logging output above.
158 verbose exit [ 1, true ]
159 verbose unbuild node_modules/msi-keyboard/node_modules/node-hid
160 info preuninstall [email protected]
161 info uninstall [email protected]
162 verbose unbuild rmStuff [email protected] from /home/schindler/Downloads/msi-klm/node_modules
163 verbose unbuild rmStuff in /home/schindler/Downloads/msi-klm/node_modules/msi-keyboard/node_modules
164 info postuninstall [email protected]
165 silly gentlyRm /home/schindler/Downloads/msi-klm/node_modules/msi-keyboard/node_modules/node-hid is being purged from base /home/schindler/Downloads/msi-klm
166 verbose gentlyRm don't care about contents; nuking /home/schindler/Downloads/msi-klm/node_modules/msi-keyboard/node_modules/node-hid
167 silly vacuum-fs purging /home/schindler/Downloads/msi-klm/node_modules/msi-keyboard/node_modules/node-hid
168 silly vacuum-fs removing /home/schindler/Downloads/msi-klm/node_modules/msi-keyboard/node_modules
169 silly vacuum-fs quitting because other entries in /home/schindler/Downloads/msi-klm/node_modules/msi-keyboard
170 verbose unbuild node_modules/msi-keyboard
171 info preuninstall [email protected]
172 info uninstall [email protected]
173 verbose unbuild rmStuff [email protected] from /home/schindler/Downloads/msi-klm/node_modules
174 info postuninstall [email protected]
175 silly gentlyRm /home/schindler/Downloads/msi-klm/node_modules/msi-keyboard is being purged from base /home/schindler/Downloads/msi-klm
176 verbose gentlyRm don't care about contents; nuking /home/schindler/Downloads/msi-klm/node_modules/msi-keyboard
177 silly vacuum-fs purging /home/schindler/Downloads/msi-klm/node_modules/msi-keyboard
178 silly vacuum-fs removing /home/schindler/Downloads/msi-klm/node_modules
179 silly vacuum-fs finished vacuuming up to /home/schindler/Downloads/msi-klm

$ node --version
v0.12.2

cannot open device with vendor id 0x1770 and product id 0xff00

Hello!

I'm trying to use your software but I get this error running the sample. I have a MSI GS70 2PC Stealth.

This is the error I get.

cannot open device with vendor id 0x1770 and product id 0xff00

This is the sample I'm running.

// require the LED module
var keyboard = require('msi-keyboard');

// Set left region to high intensity, color red
keyboard.color('left', {
    color: 'red',
    intensity: 'high'
});

// Set middle region to green default high intensity
keyboard.color('middle', 'green');


// Set right region to blue with light intensity
keyboard.color('right', {
    color: 'blue',
    intensity: 'light',
});


// Hardware modes
// Setting .color() will Not affect the hardware defined colors for modes

// Set Hardware mode to breath
keyboard.mode('breathe');


// Blinking
// Set the keyboard.color() Before calling .blink()
// Refer to examples/blinkMulti.js

// Blink all the keyboard LEDs to 750ms
keyboard.blink(750);


// Blink Only left and right regions at 750ms
keyboard.blink(['left','right'], 750);


// Use the default blink, time: 1000ms
keyboard.blink();


// Stop the blink after 5000ms
setTimeout(keyboard.stopBlink, 5000);

Can you please help me?

"Error: Module did not self-register" when using node v0.12

When running sudo node examples/sample.js using node version v0.12.0, I get the following error message:

module.js:355
  Module._extensions[extension](this, filename);
                               ^
Error: Module did not self-register.
    at Error (native)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/home/alice/config/msi-keyboard/node_modules/node-hid/index.js:5:15)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)

Everything works fine using v0.10.35.

Does it support MSI WE73?

It has the same USB device ID for the keyboard (1770:ff00) but setting any color does not seem to have any effect. Would love to be able to turn the backlight on/off...

Readme/Dev thoughts

Hello, I'm not sure the best way to write it myself, but:
I'm successfully using this and stevelacy/msi-keyboard-gui on Debian 9 (Stretch)

OS: Debian
Kernel: 4.6.0-1-amd64
Node: v6.3.0
libusb v2:0.1.12-30

Could you add somewhere that running node-hid may require navigating into './nodemodules/node-hidand runningnpm install`?

Maybe this project needs a wiki form of the Closed Pull requests, there is good information in there.

Do you have any ideas on how to run this program without sudo?

MSI GE70 issues

I tested this code on MSI GE-70 in a static color mode and found two issues:

  1. The 'green' color is not actually green. It looks more like yellow. Also, original control software do not limits user to a set of colors, it allows selection from full RGB space. Maybe there is a protocol that accepts RGB values?

  2. Hardware backlight button acts like hardware backlight switch. But original driver hooks this button and change backlight layers on press.

Unfortunately, at this time I cannot reverse a keyboard protocol from original Windows drivers. I cannot get these drivers working in VirtualBox.

Ability to set arbitrary RGB colors

On my notebook (GE70) Steelseries keyboard seems to support plain RGB values which are much simplier to specify than color-intensity pairs. All packet dumps are specified in hex:

  1. Normal mode:
    1. 01 02 41 01 00 00 00 00
    2. 01 02 40 01 RR GG BB 00 — color for left region
    3. 01 02 40 02 RR GG BB 00 — color for middle region
    4. 01 02 40 03 RR GG BB 00 — color for right region
  2. Breathing/Wave/Dual color:
    1. 01 02 44 01 RR GG BB 00 — left, primary
    2. 01 02 44 02 RR GG BB 00 — left, secondary
    3. 01 02 44 03 TT TT TT 00 — timings
    4. 01 02 41 MM 00 00 00 00 — where MM is 03 for breathing, 05 for wave, 06 for dual color
    5. repeat two more times with fourth byte set to 04, 05, 06 for middle region and 07, 08, 09 for right region.

Full dumps are here. I already implemented code based on these dumps in C++ and it seems to work well.

No 'breathe' and 'wave' on MSI GX70 3BE

keyboard.mode('wave') and keyboard.mode('breathe') don't produce the desired effect and, actually, turn off the keyboard lights

Hardware: MSI GX70 3BE (US version)
OS: Linux kernel 3.12.0 (x86_64)
NodeJS: v0.10.22

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.