-
Notifications
You must be signed in to change notification settings - Fork 8
Documentation
- CueSDK
-
The main CueSDK class.
-
CorsairLedId :
number -
The id of a led on the keyboard
-
CorsairAccessMode :
number -
The access mode to be reported to the SDK.
-
CorsairError :
number -
A error code as reported by the SDK.
-
color :
Array -
A rgb color
-
CorsairLedColor :
Array -
A rgb color with CorsairLedId included
- CorsairLedPosition
-
CorsairProtocolDetails :
Object -
The protocol details as reported by the SDK.
-
setCallback :
function -
This callback runs after the leds have been set asynchronously.
-
fadeCallback :
function -
This callback runs after the leds have been faded asynchronously.
The main CueSDK class.
Kind: global class
Properties
| Name | Type | Description |
|---|---|---|
| this.details | CorsairProtocolDetails |
The protocol details as reported by the SDK. |
| this.lastError | CorsairError |
The last error as reported by the SDK. |
| this.fps | number |
The frames-per-second for fading. |
| this.fadeType | string |
The type of fading to be used. |
-
CueSDK
- new CueSDK([clear], [exclusive])
- .set(led, [callback], [ids])
- .setSync(a, [ids])
- .setIndividualSync(key, r, g, b, [ids])
- .setAsync(a, callback, [ids])
- .setIndividualAsync(key, r, g, b, callback, [ids])
- .fade(k, f, t, l, cb, [ids])
- .fadeAsync(k, f, t, l, cb, [ids])
- .fadeIndividualAsync(k, f, t, l, cb, [ids])
- .clear()
-
.getLeds() ⇒
Array.<CorsairLedPosition> - .close()
Create a Cue SDK object and do a handshake with the sdk.
| Param | Type | Default | Description |
|---|---|---|---|
| [clear] | boolean |
false |
If true, clear the all the leds. |
| [exclusive] | boolean |
false |
If true, enable exclusive mode. |
Set the led colors.
Kind: instance method of CueSDK
| Param | Type | Default | Description |
|---|---|---|---|
| led |
Array.<CorsairLedColor> | number | string
|
The key id with rgb values as an array. | |
| [callback] | setCallback |
The callback ran after completing the asynchonous request. | |
| [ids] | boolean |
false |
If true, use the key ids as-is. |
Set multiple led colors synchronously.
Kind: instance method of CueSDK
| Param | Type | Default | Description |
|---|---|---|---|
| a | Array.<CorsairLedColor> |
The key ids or names with rgb values as an array. | |
| [ids] | boolean |
false |
If true, use the key ids as-is. |
Set an individual led colors synchronously.
Kind: instance method of CueSDK
| Param | Type | Default | Description |
|---|---|---|---|
| key |
number | string
|
The key id or name. | |
| r | number |
Red intensity value 0..255 | |
| g | number |
Green intensity value 0..255 | |
| b | number |
Blue intensity value 0..255 | |
| [ids] | boolean |
false |
If true, use the key ids as-is. |
Set multiple led colors synchronously.
Kind: instance method of CueSDK
| Param | Type | Default | Description |
|---|---|---|---|
| a | Array.<CorsairLedColor> |
The key id with rgb values as an array. | |
| callback | setCallback |
The callback ran after completing the asynchonous request. | |
| [ids] | boolean |
false |
If true, use the key ids as-is. |
Set an individual led colors synchronously.
Kind: instance method of CueSDK
| Param | Type | Default | Description |
|---|---|---|---|
| key |
number | string
|
The key id or name. | |
| r | number |
Red intensity value 0..255 | |
| g | number |
Green intensity value 0..255 | |
| b | number |
Blue intensity value 0..255 | |
| callback | setCallback |
The callback ran after completing the asynchonous request. | |
| [ids] | boolean |
false |
If true, use the key ids as-is. |
Fade multiple or individual leds.
Kind: instance method of CueSDK
| Param | Type | Default | Description |
|---|---|---|---|
| k |
number | Array.<number>
|
Key or arrray of keys to be faded. | |
| f | color |
The starting color. | |
| t | color |
The color to fade to. | |
| l | number |
Time to fade in miliseconds | |
| cb | fadeCallback |
The callback ran after completing the asynchonous request. | |
| [ids] | boolean |
false |
If true, use the key ids as-is. |
Fade multiple or individual leds.
Kind: instance method of CueSDK
| Param | Type | Default | Description |
|---|---|---|---|
| k | Array.<number> |
Key or arrray of keys to be faded. | |
| f | color |
The starting color. | |
| t | color |
The color to fade to. | |
| l | number |
Time to fade in miliseconds | |
| cb | fadeCallback |
The callback ran after completing the asynchonous request. | |
| [ids] | boolean |
false |
If true, use the key ids as-is. |
Fade multiple or individual leds.
Kind: instance method of CueSDK
| Param | Type | Default | Description |
|---|---|---|---|
| k | number |
Key or arrray of keys to be faded. | |
| f | color |
The starting color. | |
| t | color |
The color to fade to. | |
| l | number |
Time to fade in miliseconds | |
| cb | fadeCallback |
The callback ran after completing the asynchonous request. | |
| [ids] | boolean |
false |
If true, use the key ids as-is. |
Set all leds to black.
Kind: instance method of CueSDK
cueSDK.getLeds() ⇒ Array.<CorsairLedPosition>
Get the leds as reported by the CueSDK
Kind: instance method of CueSDK
Returns: Array.<CorsairLedPosition> - l - An array containing the led's positions as reported by the sdk.
Close the connection with the SDK and release all keys.
Kind: instance method of CueSDK
The id of a led on the keyboard
The access mode to be reported to the SDK.
A error code as reported by the SDK.
A rgb color
Kind: global typedef
Properties
| Name | Type | Description |
|---|---|---|
| 0 | number |
Red intensity value 0..255 |
| 1 | number |
Green intensity value 0..255 |
| 2 | number |
Blue intensity value 0..255 |
A rgb color with CorsairLedId included
Kind: global typedef
Properties
| Name | Type | Description |
|---|---|---|
| 0 |
number | string
|
Key id or name. |
| 1 | number |
Red intensity value 0..255 |
| 2 | number |
Green intensity value 0..255 |
| 3 | number |
Blue intensity value 0..255 |
Kind: global typedef
Properties
| Name | Type | Description |
|---|---|---|
| ledId | CorsairLedId |
The id of the led. |
| top | number |
The key's distance from the top of the keyboard. |
| left | number |
The key's distance from the left of the keyboard. |
| height | number |
The key's height. |
| width | number |
The key's width. |
The protocol details as reported by the SDK.
Kind: global typedef
Properties
| Name | Type | Description |
|---|---|---|
| sdkVersion | string |
The version number of the SDK. |
| serverVersion | string |
The version number of the server. |
| sdkProtocolVersion | number |
The protocol version number. |
| serverProtocolVersion | number |
The server's protocol version number. |
| breakingChanges | boolean |
True if this update contained breaking changes. |
This callback runs after the leds have been set asynchronously.
This callback runs after the leds have been faded asynchronously.
Kind: global typedef