Git Product home page Git Product logo

java-cue-sdk's Introduction

Corsair CUE SDK wrapper for Java

Description

This wrapper is based on an JNA interface generated by JNAerator.

The CueSDK class provides some helper methods to access the most common needs from the native SDK, simplifying handling arrays of structs, etc.

Usage Example

package dk.allanmc.test;

import dk.allanmc.cuesdk.LedColor;
import dk.allanmc.cuesdk.CueSDK;

public class CueSDKExample {
    public static void main(String[] args) throws InterruptedException {
        // Establish connection with device
        final CueSDK cue = new CueSDK(true);

        // Set LED of the Enter key to red
        cue.setLedColor(new LedColor(LedId.CLK_Enter, 255, 0, 0));
        // Set LED of the left Shift key to green
        cue.setLedColor(new LedColor(LedId.CLK_RightShift, Color.GREEN));

        // Set color of multiple keys at the same time
        cue.setLedsColors(Arrays.asList(
                new LedColor(LedId.CLK_W, Color.YELLOW),
                new LedColor(LedId.CLK_A, Color.YELLOW),
                new LedColor(LedId.CLK_S, Color.YELLOW),
                new LedColor(LedId.CLK_D, Color.YELLOW)
        ));

        // Wait some time before exiting, so we can see the LEDs.
        Thread.sleep(1000);
    }

}

Reference

public CueSDK()

Instantiates a new CueSDK, and establishes a connection to the Corsair SDK with shared control.

public CueSDK(boolean exclusiveLightingControl)

Instantiates a new CueSDK, and establishes a connection to the Corsair SDK with shared or exclusive control.

  • Parameters: exclusiveLightingControl — Whether exclusive light control is needed or not.
public int getDeviceCount()

Get the number of connected devices compatible with the Corsair CUE SDK.

  • Returns: number of devices
public DeviceInfo getDeviceInfo(int deviceIndex)

Retrieve information about a connected device.

  • Parameters: deviceIndex — Index of the connected device to get information about
  • Returns: device information
public List<LedPosition> getLedPositions()

Retrieve a list of available LED positions, including their id and physical properties.

  • Returns: list of LED details
public void setLedsColors(Collection<LedColor> ledColors)

Set the color af several LED at the same time.

  • Parameters: ledColors — List of LED identifiers and colors
public void setLedColor(LedColor ledColor)

Set the color of a single LED.

  • Parameters: ledColor — LED identifier and color

java-cue-sdk's People

Contributors

allanmc avatar dependabot[bot] avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

java-cue-sdk's Issues

Maven Compilation

Good evening,
I'd like to use your API to hook my keyboard up to my server and have it flash when a specific action occurs. However, I can't get your maven setup to run correctly on my computer (I'm assuming because of wget, run, and generate). Would you happen to have a copy already compiled or a maven repository to this API I can use?

Thanks.

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.