Add method

This commit is contained in:
manzerbredes 2016-03-27 13:34:34 +02:00
parent 4263d0e02c
commit 37c7d1e7a6
2 changed files with 32 additions and 6 deletions

View file

@ -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));

View file

@ -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);
}
}