summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/device/Driver.java18
-rw-r--r--src/device/Keyboard.java20
2 files changed, 32 insertions, 6 deletions
diff --git a/src/device/Driver.java b/src/device/Driver.java
index fe57fd7..d629aa7 100644
--- a/src/device/Driver.java
+++ b/src/device/Driver.java
@@ -95,12 +95,6 @@ public class Driver{
}
}
-
-
-
-
-
-
/**
* Device entry
*/
@@ -154,6 +148,13 @@ public class Driver{
}
+ /**
+ * Set Color of region
+ *
+ * @param region Region to apply
+ * @param color Color to apply
+ * @param intensity Intensity wanted
+ */
public void setColor(Region region, Color color, Intensity intensity){
try {
this.device.sendFeatureReport(this.getReport(1,2,66,region.intValue(),color.intValue(),intensity.intValue(),0,236));
@@ -163,6 +164,11 @@ public class Driver{
}
}
+ /**
+ * Commit change
+ *
+ * @param mode Mode wanted
+ */
public void commit(Mode mode){
try {
this.device.sendFeatureReport(this.getReport(1,2,65,mode.intValue(),0,0,0,236));
diff --git a/src/device/Keyboard.java b/src/device/Keyboard.java
index e311413..4acf4a1 100644
--- a/src/device/Keyboard.java
+++ b/src/device/Keyboard.java
@@ -57,4 +57,24 @@ public class Keyboard{
}
+ /**
+ *
+ * Change region keyboard color
+ *
+ * @param region Region to apply the color
+ * @param color Color to apply
+ * @param intensity Intensity wanted
+ */
+ public void setRegionColor(Region region, Color color, Intensity intensity){
+ // Save state
+ this.KeyboardColor.put(region, color);
+
+ // Set color
+ this.device.setColor(region, color, intensity);
+
+ // Apply color
+ this.device.commit(this.mode);
+
+ }
+
} \ No newline at end of file