Giter Site home page Giter Site logo

corsair-cue-java's Introduction

Corsair CUE SDK Wrapper for Java

What is It?

A Java Wrapper to connect to the Corsair ICUE (CUE) SDK. Control your corsair lighting from Java! Migrated to Gradle. Completely rewritten, easier to use, and with more features.

Note: Do not mess with DeviceIdHandler.

Installation

Currently, you can add the jar manually to the classpath from the releases. I will be making a maven repo for it soon.

Building

On every build task, an updated version of the SDK will be downloaded and added to the resource folder. Ensure that JNA is included in the JAR as issues will arise without it.

If the SDK updates on the Corsair Downloads site, update the download link in the DownloadCUESdk task of build.gradle.

The project now uses Lombok, follow this this guide to configure it with your IDE.

Documentation

See the wiki.

Quick Start Example

package ca.fiercest.test;

import ca.fiercest.cuesdk.CueSDK;
import ca.fiercest.cuesdk.enums.LedId;
import ca.fiercest.cuesdk.Color;

import java.util.Map;
import java.util.HashMap;

public class CueSDKExample 
{
    public static void main(String... args) throws Exception 
    {
        //Connect to the Corsair Cue SDK with the CueSDK object.
        final CueSDK sdk = new CueSDK(true);

        // Set LED of the Enter key to red
        sdk.SetLedColor(LedId.CLK_Enter, new Color(255, 0, 0));
        // Set LED of the left Shift key to green
        sdk.SetLedColor(LedId.CLK_Enter, new Color(0, 255, 0));

        // Set color of multiple keys at the same time
        Map<LedId, Color> map = new HashMap<>();
        map.put(LedId.CLK_W, new Color(255, 0, 0));
        map.put(LedId.CLK_A, new Color(0, 0, 255));
        map.put(LedId.CLK_S, new Color(0, 255, 0));
        map.put(LedId.CLK_D, new Color(255, 0, 0));
        sdk.SetLedColors(map);

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

Todo

  • Add a public maven repo.

corsair-cue-java's People

Contributors

fiercestt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

corsair-cue-java's Issues

Color Class Doesn't Handle Hex Codes Properly

Currently, the custom Color class provided does not convert integer hex codes properly. I was going to make a pull request to fix this issue but do not have permissions!
I'd love to push a fix for this one!

sdk.getLedPositions() don't work.

I have a problem, sdk.getLedPositions() does not exists, it is replaced by sdk.getLedPostitions() and sdk.getLedPostitions() calls null pointer :
Exception in thread "main" java.lang.NullPointerException
at ca.fiercest.cuesdk.CueSDK.getLedPostitions(CueSDK.java:127)
Can you help me please ?
Andsorry for my english if it's bad.

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.