ckb-next  beta-v0.2.8 at branch testing
ckb-next driver for corsair devices
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
kbperf.cpp
Go to the documentation of this file.
1 #include "kbperf.h"
2 #include "kbmode.h"
3 #include "kb.h"
4 #include "media.h"
5 #include <cmath>
6 
7 #if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
8 #define map_last(map) ((map).last())
9 #else
10 #define map_last(map) ((map).value((map).keys().last()))
11 #endif
12 
14  QObject(parent), runningPushIdx(1),
15  _iOpacity(1.f), _dpiIndicator(true), _liftHeight(MEDIUM), _angleSnap(false),
16  _needsUpdate(true), _needsSave(true) {
17  // Default DPI settings
18  dpiX[0] = dpiY[0] = 400;
19  dpiX[1] = dpiY[1] = 450;
20  dpiX[2] = dpiY[2] = 800;
21  dpiX[3] = dpiY[3] = 1500;
22  dpiX[4] = dpiY[4] = 3000;
23  dpiX[5] = dpiY[5] = 6000;
24  dpiClr[0] = QColor(255, 0, 0);
25  dpiClr[1] = QColor(255, 192, 0);
26  dpiClr[2] = QColor(255, 255, 0);
27  dpiClr[3] = QColor(0, 255, 0);
28  dpiClr[4] = QColor(0, 255, 255);
29  dpiClr[5] = QColor(255, 255, 255);
30  dpiClr[6] = QColor(192, 192, 192);
31  for(int i = 0; i < DPI_COUNT; i++)
32  dpiOn[i] = true;
33  dpiLastIdx = dpiCurIdx = 3;
36  // Default indicators
37  iColor[NUM][0] = iColor[CAPS][0] = iColor[SCROLL][0] = QColor(0, 255, 0); // Lock lights: on = green, off = black
38  iColor[NUM][1] = iColor[CAPS][1] = iColor[SCROLL][1] = QColor(0, 0, 0);
39  iColor[MACRO][0] = QColor(255, 0, 0); // Macro: on = red, off = black
40  iColor[LOCK][0] = QColor(255, 255, 255); // Win lock: on = white, off = black
41  iColor[MODE][0] = iColor[MUTE][0] = QColor(255, 255, 255, 0); // Mode, mute: on = transparent, off = black
42  iColor[MODE][1] = iColor[MACRO][1] = iColor[LOCK][1] = iColor[MUTE][1] = muteNAColor = QColor(0, 0, 0);
43  iColor[LIGHT][0] = QColor(255, 0, 0); // Brightness: red, yellow, white
44  iColor[LIGHT][1] = QColor(255, 255, 0);
45  light100Color = QColor(255, 255, 255);
46  for(int i = 0; i < HW_I_COUNT; i++){
47  // Set all lock lights to HW mode
48  iEnable[i] = false;
49  hwIType[i] = NORMAL;
50  }
51  for(int i = HW_I_COUNT; i < I_COUNT; i++){
52  // Turn all other indicators on
53  iEnable[i] = true;
54  }
55 }
56 
57 KbPerf::KbPerf(KbMode* parent, const KbPerf& other) :
58  QObject(parent), dpiCurX(other.dpiCurX), dpiCurY(other.dpiCurY), dpiCurIdx(other.dpiCurIdx), dpiLastIdx(other.dpiLastIdx), runningPushIdx(1),
59  _iOpacity(other._iOpacity), light100Color(other.light100Color), muteNAColor(other.muteNAColor), _dpiIndicator(other._dpiIndicator),
60  _liftHeight(other._liftHeight), _angleSnap(other._angleSnap),
61  _needsUpdate(true), _needsSave(true) {
62  memcpy(dpiX, other.dpiX, sizeof(dpiX));
63  memcpy(dpiY, other.dpiY, sizeof(dpiY));
64  for(int i = 0; i < DPI_COUNT + 1; i++)
65  dpiClr[i] = other.dpiClr[i];
66  memcpy(dpiOn, other.dpiOn, sizeof(dpiOn));
67  for(int i = 0; i < I_COUNT; i++){
68  iColor[i][0] = other.iColor[i][0];
69  iColor[i][1] = other.iColor[i][1];
70  }
71  memcpy(iEnable, other.iEnable, sizeof(iEnable));
72  memcpy(hwIType, other.hwIType, sizeof(hwIType));
73  // Don't copy pushed DPI states. If the other mode has any, restore the original DPI
74  if(!other.pushedDpis.isEmpty())
75  curDpi(other.pushedDpis[0]);
76 }
77 
78 const KbPerf& KbPerf::operator= (const KbPerf& other){
79  dpiCurX = other.dpiCurX; dpiCurY = other.dpiCurY; dpiCurIdx = other.dpiCurIdx; dpiLastIdx = other.dpiLastIdx; runningPushIdx = 1;
82  _needsUpdate = true; _needsSave = true;
83  memcpy(dpiX, other.dpiX, sizeof(dpiX));
84  memcpy(dpiY, other.dpiY, sizeof(dpiY));
85  for(int i = 0; i < DPI_COUNT + 1; i++)
86  dpiClr[i] = other.dpiClr[i];
87  memcpy(dpiOn, other.dpiOn, sizeof(dpiOn));
88  for(int i = 0; i < I_COUNT; i++){
89  iColor[i][0] = other.iColor[i][0];
90  iColor[i][1] = other.iColor[i][1];
91  }
92  memcpy(iEnable, other.iEnable, sizeof(iEnable));
93  memcpy(hwIType, other.hwIType, sizeof(hwIType));
94  // Don't copy pushed DPI states. If the other mode has any, restore the original DPI
95  if(!other.pushedDpis.isEmpty())
96  curDpi(other.pushedDpis[0]);
97  return other;
98 }
99 
101  return modeParent()->bind();
102 }
103 
105  return modeParent()->light();
106 }
107 
108 void KbPerf::load(CkbSettings& settings){
109  pushedDpis.clear();
110  runningPushIdx = 1;
111  _needsSave = false;
112  bool readIndicators = true;
113  if(!settings.containsGroup("Performance/Indicators")){
114  // Read old indicator settings from the lighting group, if present
115  // (ckb <= v0.2.0)
116  SGroup group(settings, "Lighting");
117  if(settings.contains("InactiveIndicators")){
118  bool inOk = false;
119  int inactive = settings.value("InactiveIndicators").toInt(&inOk);
120  if(!inOk || inactive > 2)
121  inactive = 2;
122  if(inactive == 1)
123  _iOpacity = 0.75f;
124  else if(inactive == 0)
125  _iOpacity = 0.5f;
126  else if(inactive < 0){
127  // Indicators disabled
128  iEnable[MODE] = iEnable[MACRO] = iEnable[LIGHT] = iEnable[LOCK] = iEnable[MUTE] = false;
129  }
130  bool showMute = (settings.value("ShowMute").toInt(&inOk) != 0);
131  if(inOk && !showMute)
132  iEnable[MUTE] = false;
133  readIndicators = false;
134  }
135  }
136  SGroup group(settings, "Performance");
137  // Read DPI settings
138  {
139  SGroup group(settings, "DPI");
140  for(int i = 0; i < DPI_COUNT; i++){
141  QString iStr = QString::number(i);
142  QPoint value = settings.value(iStr).toPoint();
143  if(value.isNull())
144  continue;
145  dpiX[i] = value.x(); dpiY[i] = value.y();
146  QColor color = settings.value(iStr + "RGB").toString();
147  if(color.isValid())
148  dpiClr[i] = color;
149  if(i != 0)
150  dpiOn[i] = !settings.value(iStr + "Disabled").toBool();
151  }
152  QColor color = settings.value("6RGB").toString();
153  if(color.isValid())
154  dpiClr[OTHER] = color;
155  if(settings.contains("LastIdx")){
156  dpiLastIdx = settings.value("LastIdx").toInt();
157  if(dpiLastIdx >= DPI_COUNT || dpiLastIdx < 0)
158  dpiLastIdx = 1;
159  }
160  QPoint value = settings.value("Current").toPoint();
161  if(!value.isNull())
162  curDpi(value);
163  }
164  // Read misc. mouse settings
165  _liftHeight = (height)settings.value("LiftHeight").toInt();
166  if(_liftHeight < LOW || _liftHeight > HIGH)
168  _angleSnap = settings.value("AngleSnap").toBool();
169  if(settings.contains("NoIndicator")){
170  // ckb <= v0.2.0
171  _dpiIndicator = !settings.value("NoIndicator").toBool();
172  } else {
173  _dpiIndicator = settings.value("Indicators/DPI", true).toBool();
174  }
175  // Read indicator settings
176  if(readIndicators){
177  SGroup group(settings, "Indicators");
178  _iOpacity = settings.value("Opacity", 100).toInt() / 100.f;
179  for(int i = 0; i < I_COUNT; i++){
180  SGroup group(settings, QString::number(i));
181  QColor color = settings.value("RGB0").toString();
182  if(color.isValid())
183  iColor[i][0] = color;
184  color = settings.value("RGB1").toString();
185  if(color.isValid())
186  iColor[i][1] = color;
187  if(i == LIGHT){
188  color = settings.value("RGB2").toString();
189  if(color.isValid())
190  light100Color = color;
191  } else if(i == MUTE){
192  color = settings.value("RGB2").toString();
193  if(color.isValid())
194  muteNAColor = color;
195  }
196  if(i <= HW_IMAX){
197  iEnable[i] = settings.value("Enable", false).toBool();
198  hwIType[i] = (i_hw)settings.value("Hardware", (int)NORMAL).toInt();
199  } else {
200  iEnable[i] = settings.value("Enable", true).toBool();
201  }
202  }
203  }
204  emit didLoad();
205 }
206 
207 void KbPerf::save(CkbSettings& settings){
208  _needsSave = false;
209  SGroup group(settings, "Performance");
210  {
211  SGroup group(settings, "DPI");
212  for(int i = 0; i < DPI_COUNT; i++){
213  QString iStr = QString::number(i);
214  settings.setValue(iStr, QPoint(dpiX[i], dpiY[i]));
215  settings.setValue(iStr + "RGB", dpiClr[i].name(QColor::HexArgb));
216  if(i != 0)
217  settings.setValue(iStr + "Disabled", !dpiOn[i]);
218  }
219  settings.setValue("6RGB", dpiClr[OTHER].name(QColor::HexArgb));
220  settings.setValue("LastIdx", dpiLastIdx);
221  int curX = dpiCurX, curY = dpiCurY;
222  // Ignore any pushed modes
223  if(pushedDpis.count() > 0){
224  curX = pushedDpis.value(0).x();
225  curY = pushedDpis.value(0).y();
226  }
227  settings.setValue("Current", QPoint(curX, curY));
228  }
229  settings.setValue("LiftHeight", _liftHeight);
230  settings.setValue("AngleSnap", _angleSnap);
231  {
232  SGroup group(settings, "Indicators");
233  settings.setValue("DPI", _dpiIndicator);
234  for(int i = 0; i < I_COUNT; i++){
235  SGroup group(settings, QString::number(i));
236  settings.setValue("RGB0", iColor[i][0].name(QColor::HexArgb));
237  settings.setValue("RGB1", iColor[i][1].name(QColor::HexArgb));
238  if(i == LIGHT)
239  settings.setValue("RGB2", light100Color.name(QColor::HexArgb));
240  else if(i == MUTE)
241  settings.setValue("RGB2", muteNAColor.name(QColor::HexArgb));
242  settings.setValue("Enable", iEnable[i]);
243  if(i <= HW_IMAX)
244  settings.setValue("Hardware", (int)hwIType[i]);
245  }
246  }
247 }
248 
249 void KbPerf::dpi(int index, const QPoint& newValue){
250  if(index < 0 || index >= DPI_COUNT)
251  return;
252  dpiX[index] = newValue.x();
253  dpiY[index] = newValue.y();
254  // Update current DPI if needed
255  if(dpiCurIdx == index){
256  dpiCurX = newValue.x();
257  dpiCurY = newValue.y();
258  }
259  _needsUpdate = _needsSave = true;
260 }
261 
262 void KbPerf::_curDpi(const QPoint& newDpi){
263  dpiCurX = newDpi.x();
264  dpiCurY = newDpi.y();
265  // Set current/last index
266  dpiCurIdx = -1;
267  for(int i = 0; i < DPI_COUNT; i++){
268  if(dpiCurX == dpiX[i] && dpiCurY == dpiY[i]){
269  dpiCurIdx = i;
270  if(i != 0)
271  dpiLastIdx = i;
272  break;
273  }
274  }
275  _needsUpdate = _needsSave = true;
276 }
277 
278 void KbPerf::curDpi(const QPoint& newDpi){
279  while(pushedDpis.count() > 0)
280  popDpi(pushedDpis.keys().last());
281  _curDpi(newDpi);
282 }
283 
284 quint64 KbPerf::pushDpi(const QPoint& newDpi){
285  if(pushedDpis.isEmpty())
286  // Push original DPI
287  pushedDpis[0] = curDpi();
288  quint64 index = runningPushIdx++;
289  if(runningPushIdx == 0)
290  runningPushIdx = 1;
291  pushedDpis[index] = newDpi;
292  _curDpi(newDpi);
293  return index;
294 }
295 
296 void KbPerf::popDpi(quint64 pushIdx){
297  if(pushIdx == 0 || !pushedDpis.contains(pushIdx))
298  return;
299  pushedDpis.remove(pushIdx);
300  // Set the DPI to the last-pushed value still on the stack
302  // If all values have been popped, remove the original DPI
303  if(pushedDpis.count() == 1)
304  pushedDpis.clear();
305  _needsUpdate = _needsSave = true;
306 }
307 
309  // Scroll past disabled DPIs and choose the next one up
310  int idx = curDpiIdx();
311  do {
312  idx++;
313  if(idx >= DPI_COUNT)
314  return;
315  } while(!dpiOn[idx]);
316  curDpiIdx(idx);
317 }
318 
320  int idx = curDpiIdx();
321  do {
322  idx--;
323  if(idx <= SNIPER)
324  return;
325  } while(!dpiOn[idx]);
326  curDpiIdx(idx);
327 }
328 
329 void KbPerf::getIndicator(indicator index, QColor& color1, QColor& color2, QColor& color3, bool& software_enable, i_hw& hardware_enable){
330  if(index < 0 || index >= I_COUNT)
331  return;
332  color1 = iColor[index][0];
333  color2 = iColor[index][1];
334  if(index == LIGHT)
335  color3 = light100Color;
336  else if(index == MUTE)
337  color3 = muteNAColor;
338  else
339  color3 = QColor();
340  software_enable = iEnable[index];
341  hardware_enable = (index <= HW_IMAX ? hwIType[index] : NONE);
342 }
343 
344 void KbPerf::setIndicator(indicator index, const QColor& color1, const QColor& color2, const QColor& color3, bool software_enable, i_hw hardware_enable){
345  if(index < 0 || index >= I_COUNT)
346  return;
347  iColor[index][0] = color1;
348  iColor[index][1] = color2;
349  if(index == LIGHT)
350  light100Color = color3;
351  else if(index == MUTE)
352  muteNAColor = color3;
353  iEnable[index] = software_enable;
354  if(hardware_enable == NONE)
355  hardware_enable = NORMAL;
356  if(index <= HW_IMAX)
357  hwIType[index] = hardware_enable;
358  _needsUpdate = _needsSave = true;
359 }
360 
361 void KbPerf::liftHeight(height newHeight){
362  if(newHeight < LOW || newHeight > HIGH)
363  return;
364  _liftHeight = newHeight;
365  _needsUpdate = _needsSave = true;
366 }
367 
368 void KbPerf::angleSnap(bool newAngleSnap){
369  _angleSnap = newAngleSnap;
370  _needsUpdate = _needsSave = true;
371 }
372 
373 void KbPerf::update(QFile& cmd, int notifyNumber, bool force, bool saveCustomDpi){
374  if(!force && !_needsUpdate)
375  return;
376  emit settingsUpdated();
377  _needsUpdate = false;
378  // Save DPI stage 0 (sniper)
379  cmd.write(QString("dpi 0:%1,%2").arg(dpiX[0]).arg(dpiY[0]).toLatin1());
380  // If the mouse is set to a custom DPI, save it in stage 1
381  int stage = dpiCurIdx;
382  if(stage < 0 && saveCustomDpi){
383  stage = 1;
384  cmd.write(QString(" 1:%1,%2").arg(dpiCurX).arg(dpiCurY).toLatin1());
385  } else {
386  // Otherwise, save stage 1 normally
387  if(!dpiOn[1] && stage != 1)
388  cmd.write(" 1:off");
389  else
390  cmd.write(QString(" 1:%1,%2").arg(dpiX[1]).arg(dpiY[1]).toLatin1());
391  }
392  // Save stages 1 - 5
393  for(int i = 2; i < DPI_COUNT; i++){
394  if(!dpiOn[i] && stage != i)
395  cmd.write(QString(" %1:off").arg(i).toLatin1());
396  else
397  cmd.write(QString(" %1:%2,%3").arg(i).arg(dpiX[i]).arg(dpiY[i]).toLatin1());
398  }
399  // Save stage selection, lift height, and angle snap
400  cmd.write(QString(" dpisel %1 lift %2 snap %3").arg(stage).arg(_liftHeight).arg(_angleSnap ? "on" : "off").toLatin1());
401  // Save DPI colors
402  cmd.write(" rgb");
403  for(int i = 0; i < DPI_COUNT; i++){
404  QColor color = dpiColor(i);
405  cmd.write(" dpi");
406  char output[9];
407  snprintf(output, sizeof(output), "%1d:%02x%02x%02x", i, color.red(), color.green(), color.blue());
408  cmd.write(output);
409  }
410  // Enable indicator notifications
411  cmd.write(QString("\n@%1 inotify all").arg(notifyNumber).toLatin1());
412  // Set indicator state
413  const char* iNames[HW_I_COUNT] = { "num", "caps", "scroll" };
414  for(int i = 0; i < HW_I_COUNT; i++){
415  if(hwIType[i] == ON)
416  cmd.write(" ion ");
417  else if(hwIType[i] == OFF)
418  cmd.write(" ioff ");
419  else
420  cmd.write(" iauto ");
421  cmd.write(iNames[i]);
422  }
423 }
424 
425 void KbPerf::lightIndicator(const char* name, QRgb rgba){
426  int a = round(qAlpha(rgba) * _iOpacity);
427  if(a <= 0)
428  return;
429  light()->setIndicator(name, qRgba(qRed(rgba), qGreen(rgba), qBlue(rgba), a));
430 }
431 
432 void KbPerf::applyIndicators(int modeIndex, const bool indicatorState[]){
433  light()->resetIndicators();
434  if(_iOpacity <= 0.f)
435  return;
436  if(_dpiIndicator){
437  // Set DPI indicator according to index
438  int index = curDpiIdx();
439  if(index == -1 || index > OTHER)
440  index = OTHER;
441  lightIndicator("dpi", dpiClr[index].rgba());
442  }
443  // KB indicators
444  if(iEnable[MODE]){
445  for(int i = 0; i < Kb::HWMODE_MAX; i++){
446  char name[4];
447  snprintf(name, sizeof(name), "m%d", i + 1);
448  if(modeIndex == i)
449  lightIndicator(name, iColor[MODE][0].rgba());
450  else
451  lightIndicator(name, iColor[MODE][1].rgba());
452  }
453  }
454  if(iEnable[MACRO])
455  lightIndicator("mr", iColor[MUTE][1].rgba());
456  if(iEnable[LIGHT]){
457  switch(light()->dimming()){
458  case 0: // 100%
459  lightIndicator("light", light100Color.rgba());
460  break;
461  case 1: // 67%
462  lightIndicator("light", iColor[LIGHT][1].rgba());
463  break;
464  case 2: // 33%
465  case 3: // light off
466  lightIndicator("light", iColor[LIGHT][0].rgba());
467  break;
468  }
469  }
470  if(iEnable[LOCK]){
471  if(bind()->winLock())
472  lightIndicator("lock", iColor[LOCK][0].rgba());
473  else
474  lightIndicator("lock", iColor[LOCK][1].rgba());
475  }
476  if(iEnable[MUTE]){
477  switch(getMuteState()){
478  case MUTED:
479  lightIndicator("mute", iColor[MUTE][0].rgba());
480  break;
481  case UNMUTED:
482  lightIndicator("mute", iColor[MUTE][1].rgba());
483  break;
484  default:
485  lightIndicator("mute", muteNAColor.rgba());
486  break;
487  }
488  }
489  // Lock lights
490  if(iEnable[NUM])
491  lightIndicator("numlock", indicatorState[0] ? iColor[NUM][0].rgba() : iColor[NUM][1].rgba());
492  if(iEnable[CAPS])
493  lightIndicator("caps", indicatorState[1] ? iColor[CAPS][0].rgba() : iColor[CAPS][1].rgba());
494  if(iEnable[SCROLL])
495  lightIndicator("scroll", indicatorState[2] ? iColor[SCROLL][0].rgba() : iColor[SCROLL][1].rgba());
496 }
497 
static const int HW_I_COUNT
Definition: kbperf.h:104
void setValue(const QString &key, const QVariant &value)
indicator
Definition: kbperf.h:85
bool _needsUpdate
Definition: kbperf.h:160
KbBind * bind()
Definition: kbmode.h:61
KbBind * bind() const
Definition: kbperf.cpp:100
void _curDpi(const QPoint &newDpi)
Definition: kbperf.cpp:262
int dpiCurY
Definition: kbperf.h:134
QColor light100Color
Definition: kbperf.h:151
QVariant value(const QString &key, const QVariant &defaultValue=QVariant()) const
uint runningPushIdx
Definition: kbperf.h:143
bool iEnable[I_COUNT]
Definition: kbperf.h:152
QColor dpiColor(int index) const
Definition: kbperf.h:82
#define map_last(map)
Definition: kbperf.cpp:8
bool contains(const QString &key) const
KbLight * light()
Definition: kbmode.h:60
bool dpiOn[DPI_COUNT]
Definition: kbperf.h:136
void update(QFile &cmd, int notifyNumber, bool force=false, bool saveCustomDpi=true)
Definition: kbperf.cpp:373
i_hw hwIType[HW_I_COUNT]
Definition: kbperf.h:153
void dpiDown()
Definition: kbperf.cpp:319
QMap< quint64, QPoint > pushedDpis
Definition: kbperf.h:142
height liftHeight() const
Definition: kbperf.h:38
float _iOpacity
Definition: kbperf.h:149
height _liftHeight
Definition: kbperf.h:157
void popDpi(quint64 pushIdx)
Definition: kbperf.cpp:296
KbMode * modeParent() const
Definition: kbperf.h:124
quint64 pushDpi(const QPoint &newDpi)
Definition: kbperf.cpp:284
int dpiLastIdx
Definition: kbperf.h:138
KbPerf(KbMode *parent)
Definition: kbperf.cpp:13
bool containsGroup(const QString &group)
height
Definition: kbperf.h:31
void didLoad()
Definition: moc_kbperf.cpp:134
QPoint dpi(int index) const
Definition: kbperf.h:48
Definition: kbmode.h:36
void resetIndicators()
Definition: kblight.cpp:254
bool _needsSave
Definition: kbperf.h:160
static const int HWMODE_MAX
Definition: kb.h:50
Definition: kbperf.h:15
static const int DPI_COUNT
Definition: kbperf.h:46
Definition: kbbind.h:20
QColor muteNAColor
Definition: kbperf.h:151
bool _angleSnap
Definition: kbperf.h:158
bool angleSnap() const
Definition: kbperf.h:42
void setIndicator(indicator index, const QColor &color1, const QColor &color2, const QColor &color3=QColor(), bool software_enable=true, i_hw hardware_enable=NORMAL)
Definition: kbperf.cpp:344
void getIndicator(indicator index, QColor &color1, QColor &color2, QColor &color3, bool &software_enable, i_hw &hardware_enable)
Definition: kbperf.cpp:329
muteState getMuteState()
Definition: media_linux.cpp:9
int dpiY[DPI_COUNT]
Definition: kbperf.h:133
int dpiCurX
Definition: kbperf.h:134
Definition: media.h:21
void setIndicator(const char *name, QRgb argb)
Definition: kblight.cpp:259
QPoint curDpi() const
Definition: kbperf.h:57
void dpiUp()
Definition: kbperf.cpp:308
QColor dpiClr[DPI_COUNT+1]
Definition: kbperf.h:135
QColor iColor[I_COUNT][2]
Definition: kbperf.h:150
int curDpiIdx() const
Definition: kbperf.h:61
Definition: media.h:22
const KbPerf & operator=(const KbPerf &rhs)
Definition: kbperf.cpp:78
void lightIndicator(const char *name, QRgb rgba)
Definition: kbperf.cpp:425
int dpiCurIdx
Definition: kbperf.h:134
void applyIndicators(int modeIndex, const bool indicatorState[HW_I_COUNT])
Definition: kbperf.cpp:432
void settingsUpdated()
Definition: moc_kbperf.cpp:140
i_hw
Definition: kbperf.h:98
int dpiX[DPI_COUNT]
Definition: kbperf.h:132
void save(CkbSettings &settings)
Definition: kbperf.cpp:207
KbLight * light() const
Definition: kbperf.cpp:104
static const int SNIPER
Definition: kbperf.h:46
static const int OTHER
Definition: kbperf.h:81
void load(CkbSettings &settings)
Definition: kbperf.cpp:108
bool _dpiIndicator
Definition: kbperf.h:154
static const int I_COUNT
Definition: kbperf.h:104