From a879e4a4ffb33443a2b92308970be1caadfd23ea Mon Sep 17 00:00:00 2001 From: Nolan Reker Date: Tue, 15 Mar 2016 11:43:23 -0700 Subject: [PATCH] Fix settings not "sticking" for some users Setting the keyboard mode after setting the colors causes the colors to be applied immediately. This is how the nodejs module does it. --- main.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/main.cpp b/main.cpp index d16d64e..1ff31c9 100644 --- a/main.cpp +++ b/main.cpp @@ -188,11 +188,7 @@ Example: return 1; }else{ Keyboard k; - - if(keyboardOptions.modeSet) { - k.setMode(keyboardOptions.modeOption); - } - + if(keyboardOptions.colorSet) { for(int i = 0; i < keyboardOptions.colorOptions.count(); ++i) { ColorOption *colorOption = keyboardOptions.colorOptions.at(i); @@ -200,6 +196,11 @@ Example: k.setColor(colorOption->region, colorOption->color, colorOption->intensity); } } + + if(keyboardOptions.modeSet) { + k.setMode(keyboardOptions.modeOption); + } + } /*k.setMode(MODE_NORMAL);