Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated to latest CUE SDK, added enums for extra keys on newer keyboards. #2

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 8 additions & 19 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>4.2.1</version>
<version>4.4.0</version>
</dependency>
</dependencies>

Expand All @@ -33,7 +33,7 @@
<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<version>1.2.1</version>
<version>1.3.0</version>
<executions>
<execution>
<phase>generate-sources</phase>
Expand All @@ -42,11 +42,11 @@
</goals>
<configuration>
<url>
http://softwaredownloads.corsair.com/Files/Gaming-Keyboards/Corsair-SDK-Release-v1.15.28.zip
http://softwaredownloads.corsair.com/Files/CUE/CUESDK_2.10.91.zip
</url>
<outputFileName>cuesdk.zip</outputFileName>
<outputDirectory>${project.build.directory}</outputDirectory>
<md5>e22a7036e56b54d42fdd5e8b9285c3a9</md5>
<md5>7fa9e8eac758916f1fb8209479f365ca</md5>
</configuration>
</execution>
</executions>
Expand All @@ -61,9 +61,9 @@
<configuration>
<target>
<unzip src="${project.build.directory}/cuesdk.zip" dest="${project.build.directory}/" />
<move file="${project.build.directory}/CUESDK/bin/x64/CUESDK.x64_2013.dll"
<move file="${project.build.directory}/CUESDK/bin/x64/CUESDK.x64_2015.dll"
tofile="${basedir}/src/main/resources/win32-x86-64/CueSDK.dll" />
<move file="${project.build.directory}/CUESDK/bin/i386/CUESDK_2013.dll"
<move file="${project.build.directory}/CUESDK/bin/i386/CUESDK_2015.dll"
tofile="${basedir}/src/main/resources/win32-x86/CueSDK.dll" />
</target>
</configuration>
Expand All @@ -73,19 +73,7 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.nativelibs4java</groupId>
<artifactId>maven-jnaerator-plugin</artifactId>
<version>0.12</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
Expand All @@ -103,6 +91,7 @@
</plugin>

</plugins>

</build>

<pluginRepositories>
Expand Down
38 changes: 37 additions & 1 deletion src/main/java/dk/allanmc/cuesdk/enums/LedId.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,43 @@ public enum LedId {
CLM_4,
CLH_LeftLogo,
CLH_RightLogo,
CLK_Logo;
CLK_Logo,
CLMM_Zone1,
CLMM_Zone2,
CLMM_Zone3,
CLMM_Zone4,
CLMM_Zone5,
CLMM_Zone6,
CLMM_Zone7,
CLMM_Zone8,
CLMM_Zone9,
CLMM_Zone10,
CLMM_Zone11,
CLMM_Zone12,
CLMM_Zone13,
CLMM_Zone14,
CLMM_Zone15,
CLKLP_Zone1,
CLKLP_Zone2,
CLKLP_Zone3,
CLKLP_Zone4,
CLKLP_Zone5,
CLKLP_Zone6,
CLKLP_Zone7,
CLKLP_Zone8,
CLKLP_Zone9,
CLKLP_Zone10,
CLKLP_Zone11,
CLKLP_Zone12,
CLKLP_Zone13,
CLKLP_Zone14,
CLKLP_Zone15,
CLKLP_Zone16,
CLKLP_Zone17,
CLKLP_Zone18,
CLKLP_Zone19,
CLM_5,
CLM_6;

private static LedId[] values = LedId.values();

Expand Down
80 changes: 80 additions & 0 deletions src/main/java/dk/allanmc/cuesdk/jna/CorsairDeviceInfo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
package dk.allanmc.cuesdk.jna;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
import java.util.Arrays;
import java.util.List;
/**
* contains information about device<br>
* <i>native declaration : target\CUESDK\include\CUESDK.h:72</i><br>
* This file was autogenerated by <a href="http://jnaerator.googlecode.com/">JNAerator</a>,<br>
* a tool written by <a href="http://ochafik.com/">Olivier Chafik</a> that <a href="http://code.google.com/p/jnaerator/wiki/CreditsAndLicense">uses a few opensource projects.</a>.<br>
* For help, please visit <a href="http://nativelibs4java.googlecode.com/">NativeLibs4Java</a> , <a href="http://rococoa.dev.java.net/">Rococoa</a>, or <a href="http://jna.dev.java.net/">JNA</a>.
*/
public class CorsairDeviceInfo extends Structure {
/**
* @see CorsairDeviceType<br>
* enum describing device type<br>
* C type : CorsairDeviceType
*/
public int type;
/**
* null - terminated device model(like \u201cK95RGB\u201d)<br>
* C type : const char*
*/
public Pointer model;
/**
* @see CorsairPhysicalLayout<br>
* enum describing physical layout of the keyboard or mouse<br>
* C type : CorsairPhysicalLayout
*/
public int physicalLayout;
/**
* @see CorsairLogicalLayout<br>
* enum describing logical layout of the keyboard as set in CUE settings<br>
* C type : CorsairLogicalLayout
*/
public int logicalLayout;
/** mask that describes device capabilities, formed as logical \u201cor\u201d of CorsairDeviceCaps enum values */
public int capsMask;
/** number of controllable LEDs on the device */
public int ledsCount;
public CorsairDeviceInfo() {
super();
}
protected List<String> getFieldOrder() {
return Arrays.asList("type", "model", "physicalLayout", "logicalLayout", "capsMask", "ledsCount");
}
/**
* @param type @see CorsairDeviceType<br>
* enum describing device type<br>
* C type : CorsairDeviceType<br>
* @param model null - terminated device model(like \u201cK95RGB\u201d)<br>
* C type : const char*<br>
* @param physicalLayout @see CorsairPhysicalLayout<br>
* enum describing physical layout of the keyboard or mouse<br>
* C type : CorsairPhysicalLayout<br>
* @param logicalLayout @see CorsairLogicalLayout<br>
* enum describing logical layout of the keyboard as set in CUE settings<br>
* C type : CorsairLogicalLayout<br>
* @param capsMask mask that describes device capabilities, formed as logical \u201cor\u201d of CorsairDeviceCaps enum values<br>
* @param ledsCount number of controllable LEDs on the device
*/
public CorsairDeviceInfo(int type, Pointer model, int physicalLayout, int logicalLayout, int capsMask, int ledsCount) {
super();
this.type = type;
this.model = model;
this.physicalLayout = physicalLayout;
this.logicalLayout = logicalLayout;
this.capsMask = capsMask;
this.ledsCount = ledsCount;
}
public CorsairDeviceInfo(Pointer peer) {
super(peer);
}
public static class ByReference extends CorsairDeviceInfo implements Structure.ByReference {

};
public static class ByValue extends CorsairDeviceInfo implements Structure.ByValue {

};
}
56 changes: 56 additions & 0 deletions src/main/java/dk/allanmc/cuesdk/jna/CorsairLedColor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package dk.allanmc.cuesdk.jna;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
import java.util.Arrays;
import java.util.List;
/**
* contains information about led and its color<br>
* <i>native declaration : target\CUESDK\include\CUESDK.h:97</i><br>
* This file was autogenerated by <a href="http://jnaerator.googlecode.com/">JNAerator</a>,<br>
* a tool written by <a href="http://ochafik.com/">Olivier Chafik</a> that <a href="http://code.google.com/p/jnaerator/wiki/CreditsAndLicense">uses a few opensource projects.</a>.<br>
* For help, please visit <a href="http://nativelibs4java.googlecode.com/">NativeLibs4Java</a> , <a href="http://rococoa.dev.java.net/">Rococoa</a>, or <a href="http://jna.dev.java.net/">JNA</a>.
*/
public class CorsairLedColor extends Structure {
/**
* @see CorsairLedId<br>
* identifier of LED to set<br>
* C type : CorsairLedId
*/
public int ledId;
/** red brightness[0..255] */
public int r;
/** green brightness[0..255] */
public int g;
/** blue brightness[0..255] */
public int b;
public CorsairLedColor() {
super();
}
protected List<String> getFieldOrder() {
return Arrays.asList("ledId", "r", "g", "b");
}
/**
* @param ledId @see CorsairLedId<br>
* identifier of LED to set<br>
* C type : CorsairLedId<br>
* @param r red brightness[0..255]<br>
* @param g green brightness[0..255]<br>
* @param b blue brightness[0..255]
*/
public CorsairLedColor(int ledId, int r, int g, int b) {
super();
this.ledId = ledId;
this.r = r;
this.g = g;
this.b = b;
}
public CorsairLedColor(Pointer peer) {
super(peer);
}
public static class ByReference extends CorsairLedColor implements Structure.ByReference {

};
public static class ByValue extends CorsairLedColor implements Structure.ByValue {

};
}
54 changes: 54 additions & 0 deletions src/main/java/dk/allanmc/cuesdk/jna/CorsairLedPosition.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package dk.allanmc.cuesdk.jna;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
import java.util.Arrays;
import java.util.List;
/**
* contains led id and position of led rectangle.Most of the keys are rectangular.In case if key is not rectangular(like Enter in ISO / UK layout) it returns the smallest rectangle that fully contains the key<br>
* <i>native declaration : target\CUESDK\include\CUESDK.h:82</i><br>
* This file was autogenerated by <a href="http://jnaerator.googlecode.com/">JNAerator</a>,<br>
* a tool written by <a href="http://ochafik.com/">Olivier Chafik</a> that <a href="http://code.google.com/p/jnaerator/wiki/CreditsAndLicense">uses a few opensource projects.</a>.<br>
* For help, please visit <a href="http://nativelibs4java.googlecode.com/">NativeLibs4Java</a> , <a href="http://rococoa.dev.java.net/">Rococoa</a>, or <a href="http://jna.dev.java.net/">JNA</a>.
*/
public class CorsairLedPosition extends Structure {
/**
* @see CorsairLedId<br>
* identifier of led<br>
* C type : CorsairLedId
*/
public int ledId;
public double top;
public double left;
public double height;
/** values in mm */
public double width;
public CorsairLedPosition() {
super();
}
protected List<String> getFieldOrder() {
return Arrays.asList("ledId", "top", "left", "height", "width");
}
/**
* @param ledId @see CorsairLedId<br>
* identifier of led<br>
* C type : CorsairLedId<br>
* @param width values in mm
*/
public CorsairLedPosition(int ledId, double top, double left, double height, double width) {
super();
this.ledId = ledId;
this.top = top;
this.left = left;
this.height = height;
this.width = width;
}
public CorsairLedPosition(Pointer peer) {
super(peer);
}
public static class ByReference extends CorsairLedPosition implements Structure.ByReference {

};
public static class ByValue extends CorsairLedPosition implements Structure.ByValue {

};
}
46 changes: 46 additions & 0 deletions src/main/java/dk/allanmc/cuesdk/jna/CorsairLedPositions.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package dk.allanmc.cuesdk.jna;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
import java.util.Arrays;
import java.util.List;
/**
* contains number of leds and arrays with their positions<br>
* <i>native declaration : target\CUESDK\include\CUESDK.h:91</i><br>
* This file was autogenerated by <a href="http://jnaerator.googlecode.com/">JNAerator</a>,<br>
* a tool written by <a href="http://ochafik.com/">Olivier Chafik</a> that <a href="http://code.google.com/p/jnaerator/wiki/CreditsAndLicense">uses a few opensource projects.</a>.<br>
* For help, please visit <a href="http://nativelibs4java.googlecode.com/">NativeLibs4Java</a> , <a href="http://rococoa.dev.java.net/">Rococoa</a>, or <a href="http://jna.dev.java.net/">JNA</a>.
*/
public class CorsairLedPositions extends Structure {
/** integer value.Number of elements in following array */
public int numberOfLed;
/**
* array of led positions<br>
* C type : CorsairLedPosition*
*/
public dk.allanmc.cuesdk.jna.CorsairLedPosition.ByReference pLedPosition;
public CorsairLedPositions() {
super();
}
protected List<String> getFieldOrder() {
return Arrays.asList("numberOfLed", "pLedPosition");
}
/**
* @param numberOfLed integer value.Number of elements in following array<br>
* @param pLedPosition array of led positions<br>
* C type : CorsairLedPosition*
*/
public CorsairLedPositions(int numberOfLed, dk.allanmc.cuesdk.jna.CorsairLedPosition.ByReference pLedPosition) {
super();
this.numberOfLed = numberOfLed;
this.pLedPosition = pLedPosition;
}
public CorsairLedPositions(Pointer peer) {
super(peer);
}
public static class ByReference extends CorsairLedPositions implements Structure.ByReference {

};
public static class ByValue extends CorsairLedPositions implements Structure.ByValue {

};
}
Loading