Skip to content

Documentation

Yannick de Jong edited this page Aug 2, 2016 · 1 revision

Classes

CueSDK

The main CueSDK class.

Typedefs

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.

CueSDK

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.

new CueSDK([clear], [exclusive])

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.

cueSDK.set(led, [callback], [ids])

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.

cueSDK.setSync(a, [ids])

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.

cueSDK.setIndividualSync(key, r, g, b, [ids])

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.

cueSDK.setAsync(a, callback, [ids])

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.

cueSDK.setIndividualAsync(key, r, g, b, callback, [ids])

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.

cueSDK.fade(k, f, t, l, cb, [ids])

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.

cueSDK.fadeAsync(k, f, t, l, cb, [ids])

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.

cueSDK.fadeIndividualAsync(k, f, t, l, cb, [ids])

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.

cueSDK.clear()

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.

cueSDK.close()

Close the connection with the SDK and release all keys.

Kind: instance method of CueSDK

CorsairLedId : number

The id of a led on the keyboard

Kind: global typedef

CorsairAccessMode : number

The access mode to be reported to the SDK.

Kind: global typedef

CorsairError : number

A error code as reported by the SDK.

Kind: global typedef

color : Array

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

CorsairLedColor : Array

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

CorsairLedPosition

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.

CorsairProtocolDetails : Object

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.

setCallback : function

This callback runs after the leds have been set asynchronously.

Kind: global typedef

fadeCallback : function

This callback runs after the leds have been faded asynchronously.

Kind: global typedef