diff --git a/src/gui/animscript.cpp b/src/gui/animscript.cpp index f8d9d2af..8e012d62 100644 --- a/src/gui/animscript.cpp +++ b/src/gui/animscript.cpp @@ -10,12 +10,12 @@ QHash AnimScript::scripts; AnimScript::AnimScript(QObject* parent, const QString& path) : - QObject(parent), _path(path), initialized(false), process(0) + QObject(parent), _path(path), initialized(false), process(nullptr) { } AnimScript::AnimScript(QObject* parent, const AnimScript& base) : - QObject(parent), _info(base._info), _path(base._path), initialized(false), process(0) + QObject(parent), _info(base._info), _path(base._path), initialized(false), process(nullptr) { } @@ -88,7 +88,7 @@ QList AnimScript::list(){ } AnimScript* AnimScript::copy(QObject* parent, const QUuid& id){ - return scripts.contains(id) ? new AnimScript(parent, *scripts.value(id)) : 0; + return scripts.contains(id) ? new AnimScript(parent, *scripts.value(id)) : nullptr; } inline QString urlParam(const QString& param){ @@ -414,7 +414,7 @@ void AnimScript::end(){ process->kill(); connect(process, SIGNAL(finished(int)), process, SLOT(deleteLater())); disconnect(process, SIGNAL(readyReadStandardOutput()), this, SLOT(readProcess())); - process = 0; + process = nullptr; } } void AnimScript::readProcessErr(){ diff --git a/src/gui/animsettingdialog.cpp b/src/gui/animsettingdialog.cpp index 829125d1..e112f800 100644 --- a/src/gui/animsettingdialog.cpp +++ b/src/gui/animsettingdialog.cpp @@ -19,7 +19,7 @@ static inline int angleFlip(int angle){ AnimSettingDialog::AnimSettingDialog(QWidget* parent, KbAnim* anim) : QDialog(parent), - ui(new Ui::AnimSettingDialog), stopCheck(0), kpStopCheck(0), + ui(new Ui::AnimSettingDialog), stopCheck(nullptr), kpStopCheck(nullptr), _anim(anim), lastDuration(1.0) { ui->setupUi(this); @@ -50,7 +50,7 @@ AnimSettingDialog::AnimSettingDialog(QWidget* parent, KbAnim* anim) : if(param.type != AnimScript::Param::BOOL && param.type != AnimScript::Param::LABEL) ui->settingsGrid->addWidget(new QLabel(param.prefix, this), row, 1); // Configure and display main widget - QWidget* widget = 0; + QWidget* widget = nullptr; int colSpan = 1; QString postfix = param.postfix; switch(param.type){ @@ -103,7 +103,7 @@ AnimSettingDialog::AnimSettingDialog(QWidget* parent, KbAnim* anim) : QColor color; if(val.length() == 8){ color = "#" + val.right(6); - color.setAlpha(val.left(2).toInt(0, 16)); + color.setAlpha(val.left(2).toInt(nullptr, 16)); } else color = "#" + val; ((ColorButton*)widget)->color(color); diff --git a/src/gui/batterysystemtrayicon.h b/src/gui/batterysystemtrayicon.h index 7a907048..cfce6b96 100644 --- a/src/gui/batterysystemtrayicon.h +++ b/src/gui/batterysystemtrayicon.h @@ -16,7 +16,7 @@ class BatteryStatusTrayIcon : public CkbSystemTrayIcon { Q_OBJECT public: - BatteryStatusTrayIcon( QString _name, QObject* parent = 0 ) + BatteryStatusTrayIcon( QString _name, QObject* parent = nullptr ) : CkbSystemTrayIcon(QIcon(":/img/ckb-next-monochrome.png"), "ckb-next-monochrome", parent), name(_name) { QMenu* menu = new QMenu(); QAction* nameAct = new QAction(name); diff --git a/src/gui/ckbsettings.cpp b/src/gui/ckbsettings.cpp index a40100db..4f397a02 100644 --- a/src/gui/ckbsettings.cpp +++ b/src/gui/ckbsettings.cpp @@ -7,14 +7,14 @@ #include // Shared global QSettings object -static QSettings* _globalSettings = 0; -static QThread* globalThread = 0; +static QSettings* _globalSettings = nullptr; +static QThread* globalThread = nullptr; QAtomicInt cacheWritesInProgress(0); // Global one-shot settings cache, to avoid reading/writing QSettings constantly static QMap globalCache; // Mutexes for accessing settings QMutex settingsMutex(QMutex::Recursive), settingsCacheMutex(QMutex::Recursive); -#define lockMutex QMutexLocker locker(backing == _globalSettings ? &settingsMutex : 0) +#define lockMutex QMutexLocker locker(backing == _globalSettings ? &settingsMutex : nullptr) #define lockMutexStatic QMutexLocker locker(&settingsMutex) #define lockMutexStatic2 QMutexLocker locker2(&settingsMutex) #define lockMutexCache QMutexLocker locker(&settingsCacheMutex) @@ -119,8 +119,8 @@ void CkbSettings::cleanUp(){ globalThread->wait(); delete globalThread; delete _globalSettings; - globalThread = 0; - _globalSettings = 0; + globalThread = nullptr; + _globalSettings = nullptr; } CkbSettings::CkbSettings() : diff --git a/src/gui/ckbsystemtrayicon.h b/src/gui/ckbsystemtrayicon.h index 68566c50..5762380d 100644 --- a/src/gui/ckbsystemtrayicon.h +++ b/src/gui/ckbsystemtrayicon.h @@ -16,7 +16,7 @@ class CkbSystemTrayIcon : public QSystemTrayIcon { public: #ifdef USE_DBUS_MENU void setIcon(QIcon icon, QString name); - CkbSystemTrayIcon(const QIcon& icon, const QString iconName, QObject* parent = 0); + CkbSystemTrayIcon(const QIcon& icon, const QString iconName, QObject* parent = nullptr); inline void show() { setStatus(KStatusNotifierItem::Active); } inline void hide() { setStatus(KStatusNotifierItem::Passive); } inline void setVisible(bool visible) { setStatus((visible ? KStatusNotifierItem::Active : KStatusNotifierItem::Passive)); } @@ -27,7 +27,7 @@ signals: private: QString previousPath; #else - CkbSystemTrayIcon(const QIcon& icon, const QString iconName, QObject* parent = 0) : QSystemTrayIcon(icon, parent) {} + CkbSystemTrayIcon(const QIcon& icon, const QString iconName, QObject* parent = nullptr) : QSystemTrayIcon(icon, parent) {} virtual bool event(QEvent* evt) { if(evt->type() == QEvent::Wheel) { diff --git a/src/gui/ckbupdater.h b/src/gui/ckbupdater.h index b7f31375..9412e71c 100644 --- a/src/gui/ckbupdater.h +++ b/src/gui/ckbupdater.h @@ -10,7 +10,7 @@ class CkbUpdater : public QObject { Q_OBJECT public: - explicit CkbUpdater(QObject *parent = 0); + explicit CkbUpdater(QObject *parent = nullptr); void checkForNewVersion(); private: diff --git a/src/gui/ckbupdaterwidget.h b/src/gui/ckbupdaterwidget.h index 86ea709c..d6ebf036 100644 --- a/src/gui/ckbupdaterwidget.h +++ b/src/gui/ckbupdaterwidget.h @@ -14,7 +14,7 @@ class CkbUpdaterDialog : public QDialog Q_OBJECT public: - explicit CkbUpdaterDialog(const QString& ver, const QString& changelog, QWidget *parent = 0); + explicit CkbUpdaterDialog(const QString& ver, const QString& changelog, QWidget *parent = nullptr); ~CkbUpdaterDialog(); private slots: diff --git a/src/gui/colorbutton.h b/src/gui/colorbutton.h index cc4fe815..e44ab7e5 100644 --- a/src/gui/colorbutton.h +++ b/src/gui/colorbutton.h @@ -7,7 +7,7 @@ class ColorButton : public QPushButton { Q_OBJECT public: - explicit ColorButton(QWidget* parent = 0, bool allowAlpha = false); + explicit ColorButton(QWidget* parent = nullptr, bool allowAlpha = false); // Current color inline const QColor& color() const { return _color; } diff --git a/src/gui/colormap.cpp b/src/gui/colormap.cpp index c5fff5f4..f9161778 100644 --- a/src/gui/colormap.cpp +++ b/src/gui/colormap.cpp @@ -1,7 +1,7 @@ #include "colormap.h" ColorMap::ColorMap() : - _keyNames(0), _colors(0), _count(0), _mapCount(0) + _keyNames(nullptr), _colors(nullptr), _count(0), _mapCount(0) { } @@ -10,7 +10,7 @@ ColorMap::~ColorMap(){ } ColorMap::ColorMap(const ColorMap& rhs) : - _keyNames(0), _colors(0), _count(0), _mapCount(0) + _keyNames(nullptr), _colors(nullptr), _count(0), _mapCount(0) { *this = rhs; } @@ -91,20 +91,20 @@ void ColorMap::init(const KeyMap& map){ QRgb* ColorMap::colorForName(const char* name){ if(!_keyNames) - return 0; + return nullptr; const char** namePtr = (const char**)bsearch(&name, _keyNames, _count, sizeof(const char*), qs_strcmp); if(!namePtr) - return 0; + return nullptr; ptrdiff_t position = namePtr - _keyNames; return _colors + position; } const QRgb* ColorMap::colorForName(const char* name) const { if(!_keyNames) - return 0; + return nullptr; const char** namePtr = (const char**)bsearch(&name, _keyNames, _count, sizeof(const char*), qs_strcmp); if(!namePtr) - return 0; + return nullptr; ptrdiff_t position = namePtr - _keyNames; return _colors + position; } diff --git a/src/gui/extrasettingswidget.h b/src/gui/extrasettingswidget.h index 4403afc3..949eff94 100644 --- a/src/gui/extrasettingswidget.h +++ b/src/gui/extrasettingswidget.h @@ -12,7 +12,7 @@ class ExtraSettingsWidget : public QWidget Q_OBJECT public: - explicit ExtraSettingsWidget(QWidget *parent = 0); + explicit ExtraSettingsWidget(QWidget *parent = nullptr); ~ExtraSettingsWidget(); void pollUpdates(); diff --git a/src/gui/fwupgradedialog.cpp b/src/gui/fwupgradedialog.cpp index be3ec376..47a98867 100644 --- a/src/gui/fwupgradedialog.cpp +++ b/src/gui/fwupgradedialog.cpp @@ -15,7 +15,7 @@ struct KbId { FwUpgradeDialog::FwUpgradeDialog(QWidget* parent, CkbVersionNumber newV, const QByteArray& fwBlob, Kb* device) : QDialog(parent), ui(new Ui::FwUpgradeDialog), - blob(fwBlob), kb(device), evLoop(0), exitSuccess(true) + blob(fwBlob), kb(device), evLoop(nullptr), exitSuccess(true) { ui->setupUi(this); ui->curLabel->setText(kb->firmware.app.toString()); diff --git a/src/gui/gradientbutton.h b/src/gui/gradientbutton.h index 6d4139d9..3d163b95 100644 --- a/src/gui/gradientbutton.h +++ b/src/gui/gradientbutton.h @@ -7,7 +7,7 @@ class GradientButton : public QPushButton { Q_OBJECT public: - explicit GradientButton(QWidget* parent = 0, bool allowAlpha = false); + explicit GradientButton(QWidget* parent = nullptr, bool allowAlpha = false); void fromString(const QString& string); QString toString() const; diff --git a/src/gui/gradientdialog.cpp b/src/gui/gradientdialog.cpp index 890ca9ae..6e8d5597 100644 --- a/src/gui/gradientdialog.cpp +++ b/src/gui/gradientdialog.cpp @@ -153,7 +153,7 @@ void GradientDialog::setPreset(const QString &newPreset){ return; if(newPreset == ""){ ui->presetList->clearSelection(); - ui->presetList->setCurrentItem(0); + ui->presetList->setCurrentItem(nullptr); Preset current = presets.value(currentPreset); QString curName = ui->presetName->text().trimmed(); if(curName == "" || (curName == current.name && current.builtIn)) diff --git a/src/gui/gradientdialog.h b/src/gui/gradientdialog.h index d916e325..28e108b5 100644 --- a/src/gui/gradientdialog.h +++ b/src/gui/gradientdialog.h @@ -14,7 +14,7 @@ class GradientDialog : public QDialog Q_OBJECT public: - explicit GradientDialog(QWidget *parent = 0); + explicit GradientDialog(QWidget *parent = nullptr); ~GradientDialog(); QGradientStops getGradient(const QGradientStops& prevGradient); diff --git a/src/gui/gradientdialogwidget.h b/src/gui/gradientdialogwidget.h index 37c6adde..44a1bb2f 100644 --- a/src/gui/gradientdialogwidget.h +++ b/src/gui/gradientdialogwidget.h @@ -9,7 +9,7 @@ class GradientDialogWidget : public QWidget { Q_OBJECT public: - explicit GradientDialogWidget(QWidget *parent = 0); + explicit GradientDialogWidget(QWidget *parent = nullptr); void setStops(const QGradientStops& stops); inline QGradientStops stops() { return _stops; } diff --git a/src/gui/kb.cpp b/src/gui/kb.cpp index df1d0901..9c3e33fc 100644 --- a/src/gui/kb.cpp +++ b/src/gui/kb.cpp @@ -17,9 +17,9 @@ bool Kb::_dither = false, Kb::_mouseAccel = true; Kb::Kb(QObject *parent, const QString& path) : QThread(parent), features(QStringList()), pollrate("N/A"), monochrome(false), hwload(false), adjrate(false), firmware(), - batteryTimer(0), batteryIcon(0), showBatteryIndicator(false), devpath(path), cmdpath(path + "/cmd"), notifyPath(path + "/notify1"), macroPath(path + "/notify2"), - _currentProfile(0), _currentMode(0), _model(KeyMap::NO_MODEL), batteryLevel(0), batteryStatus(BatteryStatus::BATT_STATUS_UNKNOWN), - _hwProfile(0), prevProfile(0), prevMode(0), + batteryTimer(nullptr), batteryIcon(nullptr), showBatteryIndicator(false), devpath(path), cmdpath(path + "/cmd"), notifyPath(path + "/notify1"), macroPath(path + "/notify2"), + _currentProfile(nullptr), _currentMode(nullptr), _model(KeyMap::NO_MODEL), batteryLevel(0), batteryStatus(BatteryStatus::BATT_STATUS_UNKNOWN), + _hwProfile(nullptr), prevProfile(nullptr), prevMode(nullptr), cmd(cmdpath), notifyNumber(1), macroNumber(2), _needsSave(false), _layout(KeyMap::NO_LAYOUT), _maxDpi(0), deviceIdleTimer() { @@ -288,7 +288,7 @@ void Kb::load(){ _needsSave = false; CkbSettings settings(prefsPath); // Read profiles - KbProfile* newCurrentProfile = 0; + KbProfile* newCurrentProfile = nullptr; QString current = settings.value("CurrentProfile").toString().trimmed().toUpper(); foreach(QString guid, settings.value("Profiles").toString().split(" ")){ guid = guid.trimmed().toUpper(); @@ -479,7 +479,7 @@ void Kb::frameUpdate(){ void Kb::deletePrevious(){ disconnect(prevMode, SIGNAL(destroyed()), this, SLOT(deletePrevious())); - prevMode = 0; + prevMode = nullptr; } void Kb::hwProfile(KbProfile* newHwProfile){ @@ -494,7 +494,7 @@ void Kb::hwProfile(KbProfile* newHwProfile){ void Kb::deleteHw(){ disconnect(_hwProfile, SIGNAL(destroyed()), this, SLOT(deleteHw())); - _hwProfile = 0; + _hwProfile = nullptr; } void Kb::run(){ @@ -572,7 +572,7 @@ void Kb::readNotify(const QString& line){ // Find the hardware profile in the list of profiles QString guid = components[1]; QString modified = components[2]; - KbProfile* newProfile = 0; + KbProfile* newProfile = nullptr; foreach(KbProfile* profile, _profiles){ if(profile->id().guid == guid){ newProfile = profile; @@ -624,7 +624,7 @@ void Kb::readNotify(const QString& line){ QString guid = components[3]; QString modified = components[4]; // Look for this mode in the hardware profile - KbMode* hwMode = 0; + KbMode* hwMode = nullptr; bool isUpdated = false; foreach(KbMode* kbMode, _hwProfile->modes()){ if(kbMode->id().guid == guid){ diff --git a/src/gui/kb.h b/src/gui/kb.h index 5462a30c..87849d4e 100644 --- a/src/gui/kb.h +++ b/src/gui/kb.h @@ -89,13 +89,13 @@ public: void profiles(const QList& newProfiles) { _needsSave = true; _profiles = newProfiles; } void appendProfile(KbProfile* newProfile) { _needsSave = true; _profiles.append(newProfile); } inline int indexOf(KbProfile* profile) { return _profiles.indexOf(profile); } - inline KbProfile* find(const QUuid& id) { foreach(KbProfile* profile, _profiles) { if(profile->id().guid == id) return profile; } return 0; } + inline KbProfile* find(const QUuid& id) { foreach(KbProfile* profile, _profiles) { if(profile->id().guid == id) return profile; } return nullptr; } // Currently-selected mode inline KbMode* currentMode() { return _currentMode; } - inline KbLight* currentLight() { return !_currentMode ? 0 : _currentMode->light(); } - inline KbBind* currentBind() { return !_currentMode ? 0 : _currentMode->bind(); } - inline KbPerf* currentPerf() { return !_currentMode ? 0 : _currentMode->perf(); } + inline KbLight* currentLight() { return _currentMode ? _currentMode->light() : nullptr; } + inline KbBind* currentBind() { return _currentMode ? _currentMode->bind() : nullptr; } + inline KbPerf* currentPerf() { return _currentMode ? _currentMode->perf() : nullptr; } // Update selection void setCurrentProfile(KbProfile* profile); diff --git a/src/gui/kbanim.cpp b/src/gui/kbanim.cpp index d20eef14..11db2166 100644 --- a/src/gui/kbanim.cpp +++ b/src/gui/kbanim.cpp @@ -6,7 +6,7 @@ #include KbAnim::KbAnim(QObject* parent, const KeyMap& map, const QUuid id, CkbSettingsBase& settings) : - QObject(parent), _script(0), _map(map), + QObject(parent), _script(nullptr), _map(map), repeatTime(0), kpRepeatTime(0), stopTime(0), kpStopTime(0), repeatMsec(0), kpRepeatMsec(0), _guid(id), _isActive(false), _isActiveKp(false), _needsSave(false) { diff --git a/src/gui/kbanimwidget.cpp b/src/gui/kbanimwidget.cpp index 01aafbaa..9348f0a1 100644 --- a/src/gui/kbanimwidget.cpp +++ b/src/gui/kbanimwidget.cpp @@ -5,12 +5,12 @@ #include KbAnimWidget::KbAnimWidget(QWidget* parent) : - QWidget(parent), light(0), current(0), noReorder(false), + QWidget(parent), light(nullptr), current(nullptr), noReorder(false), ui(new Ui::KbAnimWidget) { ui->setupUi(this); ui->animList->setVisible(false); - setCurrent(0); + setCurrent(nullptr); connect(ui->animList, SIGNAL(orderChanged()), this, SLOT(reorderAnims())); } @@ -31,7 +31,7 @@ void KbAnimWidget::setLight(KbLight* newLight){ void KbAnimWidget::refreshList(){ noReorder = true; - setCurrent(0); + setCurrent(nullptr); ui->animList->clear(); animations.clear(); // Add the animations from the new lighting mode @@ -75,8 +75,8 @@ void KbAnimWidget::reorderAnims(){ } void KbAnimWidget::clearSelection(){ - ui->animList->setCurrentItem(0); - setCurrent(0); + ui->animList->setCurrentItem(nullptr); + setCurrent(nullptr); } void KbAnimWidget::addAnim(const AnimScript* base, const QStringList& keyList, const QString& name, const QMap& preset){ @@ -150,7 +150,7 @@ void KbAnimWidget::setSelectedKeys(const QStringList& keys){ void KbAnimWidget::on_animList_currentItemChanged(QListWidgetItem* cur, QListWidgetItem* prev){ if(!cur) - setCurrent(0); + setCurrent(nullptr); else setCurrent(animations[cur->data(Qt::UserRole).toUuid()]); } @@ -243,7 +243,7 @@ void KbAnimWidget::on_deleteButton_clicked(){ animList.removeAll(current); light->animList(animList); current->deleteLater(); - setCurrent(0); + setCurrent(nullptr); delete ui->animList->currentItem(); if(animations.count() == 0){ ui->animList->setVisible(false); diff --git a/src/gui/kbanimwidget.h b/src/gui/kbanimwidget.h index ab956621..ead6f57b 100644 --- a/src/gui/kbanimwidget.h +++ b/src/gui/kbanimwidget.h @@ -17,7 +17,7 @@ class KbAnimWidget : public QWidget Q_OBJECT public: - explicit KbAnimWidget(QWidget *parent = 0); + explicit KbAnimWidget(QWidget *parent = nullptr); ~KbAnimWidget(); void setLight(KbLight* newLight); diff --git a/src/gui/kbbind.cpp b/src/gui/kbbind.cpp index 602c7178..fa7c3f0c 100644 --- a/src/gui/kbbind.cpp +++ b/src/gui/kbbind.cpp @@ -206,16 +206,16 @@ void KbBind::update(QFile& cmd, int notify, bool force){ cmd.write(QString("\n@%1 rebind all notify all").arg(notify).toLatin1()); // Make sure modifier keys are included as they may be remapped globally QHash bind(_bind); - if(!_bind.contains("caps")) bind["caps"] = 0; - if(!_bind.contains("lshift")) bind["lshift"] = 0; - if(!_bind.contains("rshift")) bind["rshift"] = 0; - if(!_bind.contains("lctrl")) bind["lctrl"] = 0; - if(!_bind.contains("rctrl")) bind["rctrl"] = 0; - if(!_bind.contains("lwin")) bind["lwin"] = 0; - if(!_bind.contains("rwin")) bind["rwin"] = 0; - if(!_bind.contains("lalt")) bind["lalt"] = 0; - if(!_bind.contains("ralt")) bind["ralt"] = 0; - if(!_bind.contains("fn")) bind["fn"] = 0; + if(!_bind.contains("caps")) bind["caps"] = nullptr; + if(!_bind.contains("lshift")) bind["lshift"] = nullptr; + if(!_bind.contains("rshift")) bind["rshift"] = nullptr; + if(!_bind.contains("lctrl")) bind["lctrl"] = nullptr; + if(!_bind.contains("rctrl")) bind["rctrl"] = nullptr; + if(!_bind.contains("lwin")) bind["lwin"] = nullptr; + if(!_bind.contains("rwin")) bind["rwin"] = nullptr; + if(!_bind.contains("lalt")) bind["lalt"] = nullptr; + if(!_bind.contains("ralt")) bind["ralt"] = nullptr; + if(!_bind.contains("fn")) bind["fn"] = nullptr; QHashIterator i(bind); // Initialize String buffer for macro Key definitions (G-keys) diff --git a/src/gui/kbbindwidget.cpp b/src/gui/kbbindwidget.cpp index 83b4cec5..07da38a0 100644 --- a/src/gui/kbbindwidget.cpp +++ b/src/gui/kbbindwidget.cpp @@ -8,7 +8,7 @@ KbBindWidget::KbBindWidget(QWidget *parent) : QWidget(parent), - ui(new Ui::KbBindWidget), bind(0), profile(0), keyWidget(new KeyWidget(this)) + ui(new Ui::KbBindWidget), bind(nullptr), profile(nullptr), keyWidget(new KeyWidget(this)) { ui->setupUi(this); keyWidget->rgbMode(false); diff --git a/src/gui/kbbindwidget.h b/src/gui/kbbindwidget.h index ba6057fc..50556ca7 100644 --- a/src/gui/kbbindwidget.h +++ b/src/gui/kbbindwidget.h @@ -15,7 +15,7 @@ class KbBindWidget : public QWidget Q_OBJECT public: - explicit KbBindWidget(QWidget *parent = 0); + explicit KbBindWidget(QWidget *parent = nullptr); ~KbBindWidget(); void setBind(KbBind* newBind, KbProfile* newProfile); diff --git a/src/gui/kbfirmware.cpp b/src/gui/kbfirmware.cpp index 5797e736..95018b4c 100644 --- a/src/gui/kbfirmware.cpp +++ b/src/gui/kbfirmware.cpp @@ -11,7 +11,7 @@ static const qint64 AUTO_CHECK_TIME = 60 * 60 * 6000; KbFirmware::FW::FW() : fwVersion(CkbVersionNumber()), ckbVersion(CkbVersionNumber()) {} KbFirmware::KbFirmware() : - lastCheck(0), lastFinished(0), tableDownload(0), hasGPG(GPG_UNKNOWN) + lastCheck(0), lastFinished(0), tableDownload(nullptr), hasGPG(GPG_UNKNOWN) { // Disable bearer polling. This corrects an issue with latency spikes when // using WiFi. The problem and workaround are described here: @@ -160,7 +160,7 @@ void KbFirmware::downloadFinished(){ return; processDownload(tableDownload); tableDownload->deleteLater(); - tableDownload = 0; + tableDownload = nullptr; emit downloaded(); } diff --git a/src/gui/kblight.cpp b/src/gui/kblight.cpp index dc087f69..4de9dc2f 100644 --- a/src/gui/kblight.cpp +++ b/src/gui/kblight.cpp @@ -9,7 +9,7 @@ static int _shareDimming = -1; static QSet activeLights; KbLight::KbLight(KbMode* parent, const KeyMap& keyMap) : - QObject(parent), _previewAnim(0), lastFrameSignal(0), _dimming(0), _lastFrameDimming(0), + QObject(parent), _previewAnim(nullptr), lastFrameSignal(0), _dimming(0), _lastFrameDimming(0), _timerOrigDimming(-1), _start(false), _needsSave(true), _needsMapRefresh(true), _forceFrame(false), // Init timerDimmed as true in case a new device is initialised before the idle timer ticks to restore the brightness _timerDimmed(false) @@ -18,7 +18,7 @@ KbLight::KbLight(KbMode* parent, const KeyMap& keyMap) : } KbLight::KbLight(KbMode* parent, const KeyMap& keyMap, const KbLight& other) : - QObject(parent), _previewAnim(0), _map(other._map), _qColorMap(other._qColorMap), + QObject(parent), _previewAnim(nullptr), _map(other._map), _qColorMap(other._qColorMap), lastFrameSignal(0), _dimming(other._dimming), _lastFrameDimming(other._lastFrameDimming), _timerOrigDimming(-1), _start(false), _needsSave(true), _needsMapRefresh(true), _forceFrame(false), _timerDimmed(false) @@ -150,7 +150,7 @@ void KbLight::previewAnim(const AnimScript* base, const QStringList& keys, const void KbLight::stopPreview(){ delete _previewAnim; - _previewAnim = 0; + _previewAnim = nullptr; } KbAnim* KbLight::duplicateAnim(KbAnim* oldAnim){ diff --git a/src/gui/kblight.h b/src/gui/kblight.h index a98ee21a..26047525 100644 --- a/src/gui/kblight.h +++ b/src/gui/kblight.h @@ -48,7 +48,7 @@ public: KbAnim* duplicateAnim(KbAnim* oldAnim); const AnimList& animList() { return _animList; } void animList(const AnimList& newAnimList) { _needsSave = true; _animList = newAnimList; } - KbAnim* findAnim(const QUuid& guid) const { foreach(KbAnim* anim, _animList) { if(anim->guid() == guid) return anim; } return 0; } + KbAnim* findAnim(const QUuid& guid) const { foreach(KbAnim* anim, _animList) { if(anim->guid() == guid) return anim; } return nullptr; } int findAnimIdx(const QUuid& guid) const { return _animList.indexOf(findAnim(guid)); } // Preview animation - temporary animation displayed at the top of the animation list void previewAnim(const AnimScript* base, const QStringList& keys, const QMap& preset); diff --git a/src/gui/kblightwidget.cpp b/src/gui/kblightwidget.cpp index 2bcb4f7a..f79b9a24 100644 --- a/src/gui/kblightwidget.cpp +++ b/src/gui/kblightwidget.cpp @@ -6,7 +6,7 @@ #include "keywidgetlayout.h" KbLightWidget::KbLightWidget(QWidget *parent) : - QWidget(parent), light(0), + QWidget(parent), light(nullptr), ui(new Ui::KbLightWidget), keyWidget(new KeyWidget(this)) { ui->setupUi(this); diff --git a/src/gui/kblightwidget.h b/src/gui/kblightwidget.h index e88aa172..d850ad43 100644 --- a/src/gui/kblightwidget.h +++ b/src/gui/kblightwidget.h @@ -17,7 +17,7 @@ class KbLightWidget : public QWidget Q_OBJECT public: - explicit KbLightWidget(QWidget *parent = 0); + explicit KbLightWidget(QWidget *parent = nullptr); ~KbLightWidget(); void setLight(KbLight* newLight); diff --git a/src/gui/kbmanager.cpp b/src/gui/kbmanager.cpp index 3270dfc5..a87cc2ec 100644 --- a/src/gui/kbmanager.cpp +++ b/src/gui/kbmanager.cpp @@ -15,7 +15,7 @@ QString devpath = "/var/run/ckb%1"; #endif CkbVersionNumber KbManager::_guiVersion, KbManager::_daemonVersion; -KbManager* KbManager::_kbManager = 0; +KbManager* KbManager::_kbManager = nullptr; #ifdef USE_XCB_SCREENSAVER QTimer* KbManager::_idleTimer = nullptr; diff --git a/src/gui/kbmanager.h b/src/gui/kbmanager.h index 98c67f89..33354a64 100644 --- a/src/gui/kbmanager.h +++ b/src/gui/kbmanager.h @@ -30,12 +30,12 @@ public: // Event timer for the driver. Created during init(). Starts ticking when fps() is called. // Use this for animations or other events which need to run at a high frame rate. - static inline QTimer* eventTimer() { return _kbManager ? _kbManager->_eventTimer : 0; } + static inline QTimer* eventTimer() { return _kbManager ? _kbManager->_eventTimer : nullptr; } // Sets the frame rate for the event timer static void fps(int framerate); // Timer for scanning the driver/device list. May also be useful for periodic GUI events. Created during init(), always runs at 10FPS. - static inline QTimer* scanTimer() { return _kbManager ? _kbManager->_scanTimer : 0; } + static inline QTimer* scanTimer() { return _kbManager ? _kbManager->_scanTimer : nullptr; } inline bool getDeviceTimerDimmed() { for(Kb* kb : _devices) if(kb->currentLight()->isTimerDimmed()) { return true; } return false; } #ifdef USE_XCB_SCREENSAVER @@ -65,7 +65,7 @@ private: static KbManager* _kbManager; static CkbVersionNumber _guiVersion, _daemonVersion; - explicit KbManager(QObject* parent = 0); + explicit KbManager(QObject* parent = nullptr); QSet _devices; QTimer* _eventTimer, *_scanTimer, *_saveTimer; diff --git a/src/gui/kbmode.h b/src/gui/kbmode.h index 120e4d71..31f48a77 100644 --- a/src/gui/kbmode.h +++ b/src/gui/kbmode.h @@ -16,15 +16,15 @@ struct UsbId { quint32 hwModified; // Last modification value saved to hardware inline UsbId(const QString& _guid, quint32 _modified) : guid(_guid), modified(_modified), hwModified(_modified) {} - inline UsbId(const QString& _guid, const QString& _modified) : guid(_guid), modified(_modified.toUInt(0, 16)), hwModified(modified) {} + inline UsbId(const QString& _guid, const QString& _modified) : guid(_guid), modified(_modified.toUInt(nullptr, 16)), hwModified(modified) {} inline UsbId() : guid(QUuid::createUuid()),modified(0) {} QString guidString() const { return guid.toString().toUpper(); } void guidString(const QString& newGuid) { guid = newGuid; } QString modifiedString() const { return QString::number(modified, 16); } - void modifiedString(const QString& newModified) { modified = newModified.toUInt(0, 16); } + void modifiedString(const QString& newModified) { modified = newModified.toUInt(nullptr, 16); } QString hwModifiedString() const { return QString::number(hwModified, 16); } - void hwModifiedString(const QString& newModified){ hwModified = newModified.toUInt(0, 16); } + void hwModifiedString(const QString& newModified){ hwModified = newModified.toUInt(nullptr, 16); } // Generate a new random ID void newGuid() { guid = QUuid::createUuid(); } diff --git a/src/gui/kbprofile.cpp b/src/gui/kbprofile.cpp index 585ab59c..d19bf1ec 100644 --- a/src/gui/kbprofile.cpp +++ b/src/gui/kbprofile.cpp @@ -3,7 +3,7 @@ #include KbProfile::KbProfile(Kb* parent, const KeyMap& keyMap, const KbProfile& other) : - QObject(parent), _currentMode(0), _name(other._name), _usbId(other._usbId), _keyMap(keyMap), _needsSave(true) + QObject(parent), _currentMode(nullptr), _name(other._name), _usbId(other._usbId), _keyMap(keyMap), _needsSave(true) { foreach(KbMode* mode, other.modes()){ KbMode* newMode = new KbMode(parent, keyMap, *mode); @@ -14,14 +14,14 @@ KbProfile::KbProfile(Kb* parent, const KeyMap& keyMap, const KbProfile& other) : } KbProfile::KbProfile(Kb* parent, const KeyMap& keyMap, const QString& guid, const QString& modified) : - QObject(parent), _currentMode(0), _usbId(guid, modified.toUInt(0, 16)), _keyMap(keyMap), _needsSave(true) + QObject(parent), _currentMode(nullptr), _usbId(guid, modified.toUInt(nullptr, 16)), _keyMap(keyMap), _needsSave(true) { if(_usbId.guid.isNull()) _usbId.guid = QUuid::createUuid(); } KbProfile::KbProfile(Kb* parent, const KeyMap& keyMap, CkbSettingsBase& settings, const QString& guid) : - QObject(parent), _currentMode(0), _usbId(guid, 0), _keyMap(keyMap), _needsSave(false) + QObject(parent), _currentMode(nullptr), _usbId(guid, 0), _keyMap(keyMap), _needsSave(false) { // Load data from preferences // If we're importing external profiles, then always read the GUID from the first group. diff --git a/src/gui/kbprofile.h b/src/gui/kbprofile.h index 2f542bf1..91fe0799 100644 --- a/src/gui/kbprofile.h +++ b/src/gui/kbprofile.h @@ -48,7 +48,7 @@ public: inline int modeCount() const { return _modes.count(); } inline int indexOf(KbMode* mode) const { return _modes.indexOf(mode); } - inline KbMode* find(const QUuid& id) { foreach(KbMode* mode, _modes) { if(mode->id().guid == id) return mode; } return 0; } + inline KbMode* find(const QUuid& id) { foreach(KbMode* mode, _modes) { if(mode->id().guid == id) return mode; } return nullptr; } inline KbMode* at(const int idx) const { return _modes.at(idx); } // Currently-selected mode diff --git a/src/gui/kbprofiledialog.cpp b/src/gui/kbprofiledialog.cpp index 54bba15c..a5d75784 100644 --- a/src/gui/kbprofiledialog.cpp +++ b/src/gui/kbprofiledialog.cpp @@ -45,7 +45,7 @@ void KbProfileDialog::profileList_reordered(){ void KbProfileDialog::repopulate(){ ui->profileList->clear(); - QListWidgetItem* current = 0; + QListWidgetItem* current = nullptr; foreach(KbProfile* profile, device->profiles()){ QListWidgetItem* item = new QListWidgetItem(QIcon((profile == device->hwProfile()) ? ":/img/icon_profile_hardware.png" : ":/img/icon_profile.png"), profile->name(), ui->profileList); item->setData(GUID, profile->id().guid); diff --git a/src/gui/kbprofiledialog.h b/src/gui/kbprofiledialog.h index 05c87024..fc3adf2e 100644 --- a/src/gui/kbprofiledialog.h +++ b/src/gui/kbprofiledialog.h @@ -14,7 +14,7 @@ class KbProfileDialog : public QDialog Q_OBJECT public: - explicit KbProfileDialog(KbWidget* parent = 0); + explicit KbProfileDialog(KbWidget* parent = nullptr); ~KbProfileDialog(); private slots: diff --git a/src/gui/keyaction.cpp b/src/gui/keyaction.cpp index 891fe739..4b8519b4 100644 --- a/src/gui/keyaction.cpp +++ b/src/gui/keyaction.cpp @@ -20,12 +20,12 @@ KeyAction::Type KeyAction::type() const { } KeyAction::KeyAction(const QString &action, QObject *parent) - : QObject(parent), _value(action), preProgram(0), relProgram(0), sniperValue(0) + : QObject(parent), _value(action), preProgram(nullptr), relProgram(nullptr), sniperValue(0) { } KeyAction::KeyAction(QObject *parent) - : QObject(parent), _value(""), preProgram(0), relProgram(0), sniperValue(0) + : QObject(parent), _value(""), preProgram(nullptr), relProgram(nullptr), sniperValue(0) { } @@ -409,13 +409,13 @@ void KeyAction::keyEvent(KbBind* bind, bool down){ QString onPress, onRelease; int stop = programInfo(onPress, onRelease); // Stop running programs based on setting - QProcess* process = 0; + QProcess* process = nullptr; if(down){ if(stop & PROGRAM_PR_KPSTOP){ process = preProgram; if(process) process->kill(); - process = 0; + process = nullptr; } if(stop & PROGRAM_RE_KPSTOP) process = relProgram; diff --git a/src/gui/keyaction.h b/src/gui/keyaction.h index c4268c27..c6823e3c 100644 --- a/src/gui/keyaction.h +++ b/src/gui/keyaction.h @@ -15,11 +15,11 @@ class KeyAction : public QObject Q_OBJECT public: // Action/string conversion - KeyAction(const QString& action, QObject* parent = 0); + KeyAction(const QString& action, QObject* parent = nullptr); inline QString value() const { return _value; } inline operator QString () const { return _value; } // Empty action - explicit KeyAction(QObject* parent = 0); + explicit KeyAction(QObject* parent = nullptr); // No action static inline QString noAction() { return QString(); } diff --git a/src/gui/keymap.cpp b/src/gui/keymap.cpp index 6268425c..a409de90 100644 --- a/src/gui/keymap.cpp +++ b/src/gui/keymap.cpp @@ -14,13 +14,13 @@ // Key positions (K95 - English) // This is the master key map that includes ANSI, ISO and JP-106 layouts - use patchANSI(), patchISO() or patchJP106() to finalize it static const Key K95Keys[] = { - {0, 0, "mr", 38, 0, NS, true, true}, {0, 0, "m1", 50, 0, NS, true, true}, {0, 0, "m2", 62, 0, NS, true, true}, {0, 0, "m3", 74, 0, NS, true, true}, {0, "Brightness", "light", 222, 0, NS, true, true}, {0, "Windows Lock", "lock", 234, 0, NS, true, true}, {0, "Mute", "mute", 273, 0, 13, 8, true, true}, {0, "Volume Up", "volup", 290, -2, 18, 6, false, true}, {0, "Volume down", "voldn", 290, 2, 18, 6, false, true}, - {0, 0, "g1", 0, 14, NS, true, true}, {0, 0, "g2", 11, 14, NS, true, true}, {0, 0, "g3", 22, 14, NS, true, true}, {0, "Esc", "esc", 38, 14, NS, true, true}, {0, 0, "f1", 58, 14, NS, true, true}, {0, 0, "f2", 70, 14, NS, true, true}, {0, 0, "f3", 82, 14, NS, true, true}, {0, 0, "f4", 94, 14, NS, true, true}, {0, 0, "f5", 114, 14, NS, true, true}, {0, 0, "f6", 126, 14, NS, true, true}, {0, 0, "f7", 138, 14, NS, true, true}, {0, 0, "f8", 150, 14, NS, true, true}, {0, 0, "f9", 170, 14, NS, true, true}, {0, 0, "f10", 182, 14, NS, true, true}, {0, 0, "f11", 194, 14, NS, true, true}, {0, 0, "f12", 206, 14, NS, true, true}, {0, "Print Screen\nSysRq", "prtscn", 222, 14, NS, true, true}, {0, "Scroll Lock", "scroll", 234, 14, NS, true, true}, {0, "Pause\nBreak", "pause", 246, 14, NS, true, true}, {0, "Stop", "stop", 262, 14, 12, 8, true, true}, {0, "Previous", "prev", 273, 14, 13, 8, true, true}, {0, "Play/Pause", "play", 285, 14, 13, 8, true, true}, {0, "Next", "next", 296, 14, 12, 8, true, true}, - {0, 0, "g4", 0, 25, NS, true, true}, {0, 0, "g5", 11, 25, NS, true, true}, {0, 0, "g6", 22, 25, NS, true, true}, {0, "`", "grave", 38, 27, NS, true, true}, {0, 0, "1", 50, 27, NS, true, true}, {0, 0, "2", 62, 27, NS, true, true}, {0, 0, "3", 74, 27, NS, true, true}, {0, 0, "4", 86, 27, NS, true, true}, {0, 0, "5", 98, 27, NS, true, true}, {0, 0, "6", 110, 27, NS, true, true}, {0, 0, "7", 122, 27, NS, true, true}, {0, 0, "8", 134, 27, NS, true, true}, {0, 0, "9", 146, 27, NS, true, true}, {0, 0, "0", 158, 27, NS, true, true}, {0, "-", "minus", 170, 27, NS, true, true}, {0, "=", "equal", 182, 27, NS, true, true}, {0, "¥", "yen", 194, 27, NS, true, true}, {0, "Backspace", "bspace", 200, 27, 24, 12, true, true}, {0, "Insert", "ins", 222, 27, NS, true, true}, {0, "Home", "home", 234, 27, NS, true, true}, {0, "Page Up", "pgup", 246, 27, NS, true, true}, {0, "Num Lock", "numlock", 261, 27, NS, true, true}, {0, "NumPad /", "numslash", 273, 27, NS, true, true}, {0, "NumPad *", "numstar", 285, 27, NS, true, true}, {0, "NumPad -", "numminus", 297, 27, NS, true, true}, - {0, 0, "g7", 0, 39, NS, true, true}, {0, 0, "g8", 11, 39, NS, true, true}, {0, 0, "g9", 22, 39, NS, true, true}, {0, "Tab", "tab", 41, 39, 18, 12, true, true}, {0, 0, "q", 56, 39, NS, true, true}, {0, 0, "w", 68, 39, NS, true, true}, {0, 0, "e", 80, 39, NS, true, true}, {0, 0, "r", 92, 39, NS, true, true}, {0, 0, "t", 104, 39, NS, true, true}, {0, 0, "y", 116, 39, NS, true, true}, {0, 0, "u", 128, 39, NS, true, true}, {0, 0, "i", 140, 39, NS, true, true}, {0, 0, "o", 152, 39, NS, true, true}, {0, 0, "p", 164, 39, NS, true, true}, {0, "[", "lbrace", 176, 39, NS, true, true}, {0, "]", "rbrace", 188, 39, NS, true, true}, {0, "\\", "bslash", 203, 39, 18, 12, true, true}, {0, "Enter", "enter", 203, 45, 18, 24, true, true}, {0, "Delete", "del", 222, 39, NS, true, true}, {0, "End", "end", 234, 39, NS, true, true}, {0, "Page Down", "pgdn", 246, 39, NS, true, true}, {0, "NumPad 7", "num7", 261, 39, NS, true, true}, {0, "NumPad 8", "num8", 273, 39, NS, true, true}, {0, "NumPad 9", "num9", 285, 39, NS, true, true}, {0, "NumPad +", "numplus", 297, 45, 12, 24, true, true}, - {0, 0, "g10", 0, 50, NS, true, true}, {0, 0, "g11", 11, 50, NS, true, true}, {0, 0, "g12", 22, 50, NS, true, true}, {0, "Caps Lock", "caps", 42, 51, 20, 12, true, true}, {0, 0, "a", 59, 51, NS, true, true}, {0, 0, "s", 71, 51, NS, true, true}, {0, 0, "d", 83, 51, NS, true, true}, {0, 0, "f", 95, 51, NS, true, true}, {0, 0, "g", 107, 51, NS, true, true}, {0, 0, "h", 119, 51, NS, true, true}, {0, 0, "j", 131, 51, NS, true, true}, {0, 0, "k", 143, 51, NS, true, true}, {0, 0, "l", 155, 51, NS, true, true}, {0, ";", "colon", 167, 51, NS, true, true}, {0, "'", "quote", 179, 51, NS, true, true}, {0, "#", "hash", 191, 51, NS, true, true}, {0, "NumPad 4", "num4", 261, 51, NS, true, true}, {0, "NumPad 5", "num5", 273, 51, NS, true, true}, {0, "NumPad 6", "num6", 285, 51, NS, true, true}, - {0, 0, "g13", 0, 64, NS, true, true}, {0, 0, "g14", 11, 64, NS, true, true}, {0, 0, "g15", 22, 64, NS, true, true}, {0, "Left Shift", "lshift", 39, 63, 14, 12, true, true}, {"bslash", "\\", "bslash_iso", 53, 63, NS, true, true}, {0, 0, "z", 65, 63, NS, true, true}, {0, 0, "x", 77, 63, NS, true, true}, {0, 0, "c", 89, 63, NS, true, true}, {0, 0, "v", 101, 63, NS, true, true}, {0, 0, "b", 113, 63, NS, true, true}, {0, 0, "n", 125, 63, NS, true, true}, {0, 0, "m", 137, 63, NS, true, true}, {0, ",", "comma", 149, 63, NS, true, true}, {0, ".", "dot", 161, 63, NS, true, true}, {0, "/", "slash", 173, 63, NS, true, true}, {0, "_", "ro", 185, 63, NS, true, true}, {0, "Right Shift", "rshift", 196, 63, 32, 12, true, true}, {0, "Up", "up", 234, 63, NS, true, true}, {0, "NumPad 1", "num1", 261, 63, NS, true, true}, {0, "NumPad 2", "num2", 273, 63, NS, true, true}, {0, "NumPad 3", "num3", 285, 63, NS, true, true}, {0, "NumPad Enter", "numenter", 297, 69, 12, 24, true, true}, - {0, 0, "g16", 0, 75, NS, true, true}, {0, 0, "g17", 11, 75, NS, true, true}, {0, 0, "g18", 22, 75, NS, true, true}, {0, "Left Ctrl", "lctrl", 40, 75, 16, 12, true, true}, {0, "Left Windows", "lwin", 54, 75, NS, true, true}, {0, "Left Alt", "lalt", 67, 75, 14, 12, true, true}, {0, "無変換", "muhenkan", 80, 75, NS, true, true}, {0, "Space", "space", 116, 75, 84, 12, true, true}, {0, "変換", "henkan", 150, 75, NS, true, true}, {0, "ひらがな カタカナ ローマ字", "katahira", 162, 75, NS, true, true}, {0, "Right Alt", "ralt", 165, 75, 14, 12, true, true}, {0, "Right Windows", "rwin", 178, 75, NS, true, true}, {0, "Menu", "rmenu", 190, 75, NS, true, true}, {0, "Right Ctrl", "rctrl", 204, 75, 16, 12, true, true}, {0, "Left", "left", 222, 75, NS, true, true}, {0, "Down", "down", 234, 75, NS, true, true}, {0, "Right", "right", 246, 75, NS, true, true}, {0, "NumPad 0", "num0", 267, 75, 24, 12, true, true}, {0, "NumPad .", "numdot", 285, 75, NS, true, true} + {nullptr, nullptr, "mr", 38, 0, NS, true, true}, {nullptr, nullptr, "m1", 50, 0, NS, true, true}, {nullptr, nullptr, "m2", 62, 0, NS, true, true}, {nullptr, nullptr, "m3", 74, 0, NS, true, true}, {nullptr, "Brightness", "light", 222, 0, NS, true, true}, {nullptr, "Windows Lock", "lock", 234, 0, NS, true, true}, {nullptr, "Mute", "mute", 273, 0, 13, 8, true, true}, {nullptr, "Volume Up", "volup", 290, -2, 18, 6, false, true}, {nullptr, "Volume down", "voldn", 290, 2, 18, 6, false, true}, + {nullptr, nullptr, "g1", 0, 14, NS, true, true}, {nullptr, nullptr, "g2", 11, 14, NS, true, true}, {nullptr, nullptr, "g3", 22, 14, NS, true, true}, {nullptr, "Esc", "esc", 38, 14, NS, true, true}, {nullptr, nullptr, "f1", 58, 14, NS, true, true}, {nullptr, nullptr, "f2", 70, 14, NS, true, true}, {nullptr, nullptr, "f3", 82, 14, NS, true, true}, {nullptr, nullptr, "f4", 94, 14, NS, true, true}, {nullptr, nullptr, "f5", 114, 14, NS, true, true}, {nullptr, nullptr, "f6", 126, 14, NS, true, true}, {nullptr, nullptr, "f7", 138, 14, NS, true, true}, {nullptr, nullptr, "f8", 150, 14, NS, true, true}, {nullptr, nullptr, "f9", 170, 14, NS, true, true}, {nullptr, nullptr, "f10", 182, 14, NS, true, true}, {nullptr, nullptr, "f11", 194, 14, NS, true, true}, {nullptr, nullptr, "f12", 206, 14, NS, true, true}, {nullptr, "Print Screen\nSysRq", "prtscn", 222, 14, NS, true, true}, {nullptr, "Scroll Lock", "scroll", 234, 14, NS, true, true}, {nullptr, "Pause\nBreak", "pause", 246, 14, NS, true, true}, {nullptr, "Stop", "stop", 262, 14, 12, 8, true, true}, {nullptr, "Previous", "prev", 273, 14, 13, 8, true, true}, {nullptr, "Play/Pause", "play", 285, 14, 13, 8, true, true}, {nullptr, "Next", "next", 296, 14, 12, 8, true, true}, + {nullptr, nullptr, "g4", 0, 25, NS, true, true}, {nullptr, nullptr, "g5", 11, 25, NS, true, true}, {nullptr, nullptr, "g6", 22, 25, NS, true, true}, {nullptr, "`", "grave", 38, 27, NS, true, true}, {nullptr, nullptr, "1", 50, 27, NS, true, true}, {nullptr, nullptr, "2", 62, 27, NS, true, true}, {nullptr, nullptr, "3", 74, 27, NS, true, true}, {nullptr, nullptr, "4", 86, 27, NS, true, true}, {nullptr, nullptr, "5", 98, 27, NS, true, true}, {nullptr, nullptr, "6", 110, 27, NS, true, true}, {nullptr, nullptr, "7", 122, 27, NS, true, true}, {nullptr, nullptr, "8", 134, 27, NS, true, true}, {nullptr, nullptr, "9", 146, 27, NS, true, true}, {nullptr, nullptr, "0", 158, 27, NS, true, true}, {nullptr, "-", "minus", 170, 27, NS, true, true}, {nullptr, "=", "equal", 182, 27, NS, true, true}, {nullptr, "¥", "yen", 194, 27, NS, true, true}, {nullptr, "Backspace", "bspace", 200, 27, 24, 12, true, true}, {nullptr, "Insert", "ins", 222, 27, NS, true, true}, {nullptr, "Home", "home", 234, 27, NS, true, true}, {nullptr, "Page Up", "pgup", 246, 27, NS, true, true}, {nullptr, "Num Lock", "numlock", 261, 27, NS, true, true}, {nullptr, "NumPad /", "numslash", 273, 27, NS, true, true}, {nullptr, "NumPad *", "numstar", 285, 27, NS, true, true}, {nullptr, "NumPad -", "numminus", 297, 27, NS, true, true}, + {nullptr, nullptr, "g7", 0, 39, NS, true, true}, {nullptr, nullptr, "g8", 11, 39, NS, true, true}, {nullptr, nullptr, "g9", 22, 39, NS, true, true}, {nullptr, "Tab", "tab", 41, 39, 18, 12, true, true}, {nullptr, nullptr, "q", 56, 39, NS, true, true}, {nullptr, nullptr, "w", 68, 39, NS, true, true}, {nullptr, nullptr, "e", 80, 39, NS, true, true}, {nullptr, nullptr, "r", 92, 39, NS, true, true}, {nullptr, nullptr, "t", 104, 39, NS, true, true}, {nullptr, nullptr, "y", 116, 39, NS, true, true}, {nullptr, nullptr, "u", 128, 39, NS, true, true}, {nullptr, nullptr, "i", 140, 39, NS, true, true}, {nullptr, nullptr, "o", 152, 39, NS, true, true}, {nullptr, nullptr, "p", 164, 39, NS, true, true}, {nullptr, "[", "lbrace", 176, 39, NS, true, true}, {nullptr, "]", "rbrace", 188, 39, NS, true, true}, {nullptr, "\\", "bslash", 203, 39, 18, 12, true, true}, {nullptr, "Enter", "enter", 203, 45, 18, 24, true, true}, {nullptr, "Delete", "del", 222, 39, NS, true, true}, {nullptr, "End", "end", 234, 39, NS, true, true}, {nullptr, "Page Down", "pgdn", 246, 39, NS, true, true}, {nullptr, "NumPad 7", "num7", 261, 39, NS, true, true}, {nullptr, "NumPad 8", "num8", 273, 39, NS, true, true}, {nullptr, "NumPad 9", "num9", 285, 39, NS, true, true}, {nullptr, "NumPad +", "numplus", 297, 45, 12, 24, true, true}, + {nullptr, nullptr, "g10", 0, 50, NS, true, true}, {nullptr, nullptr, "g11", 11, 50, NS, true, true}, {nullptr, nullptr, "g12", 22, 50, NS, true, true}, {nullptr, "Caps Lock", "caps", 42, 51, 20, 12, true, true}, {nullptr, nullptr, "a", 59, 51, NS, true, true}, {nullptr, nullptr, "s", 71, 51, NS, true, true}, {nullptr, nullptr, "d", 83, 51, NS, true, true}, {nullptr, nullptr, "f", 95, 51, NS, true, true}, {nullptr, nullptr, "g", 107, 51, NS, true, true}, {nullptr, nullptr, "h", 119, 51, NS, true, true}, {nullptr, nullptr, "j", 131, 51, NS, true, true}, {nullptr, nullptr, "k", 143, 51, NS, true, true}, {nullptr, nullptr, "l", 155, 51, NS, true, true}, {nullptr, ";", "colon", 167, 51, NS, true, true}, {nullptr, "'", "quote", 179, 51, NS, true, true}, {nullptr, "#", "hash", 191, 51, NS, true, true}, {nullptr, "NumPad 4", "num4", 261, 51, NS, true, true}, {nullptr, "NumPad 5", "num5", 273, 51, NS, true, true}, {nullptr, "NumPad 6", "num6", 285, 51, NS, true, true}, + {nullptr, nullptr, "g13", 0, 64, NS, true, true}, {nullptr, nullptr, "g14", 11, 64, NS, true, true}, {nullptr, nullptr, "g15", 22, 64, NS, true, true}, {nullptr, "Left Shift", "lshift", 39, 63, 14, 12, true, true}, {"bslash", "\\", "bslash_iso", 53, 63, NS, true, true}, {nullptr, nullptr, "z", 65, 63, NS, true, true}, {nullptr, nullptr, "x", 77, 63, NS, true, true}, {nullptr, nullptr, "c", 89, 63, NS, true, true}, {nullptr, nullptr, "v", 101, 63, NS, true, true}, {nullptr, nullptr, "b", 113, 63, NS, true, true}, {nullptr, nullptr, "n", 125, 63, NS, true, true}, {nullptr, nullptr, "m", 137, 63, NS, true, true}, {nullptr, ",", "comma", 149, 63, NS, true, true}, {nullptr, ".", "dot", 161, 63, NS, true, true}, {nullptr, "/", "slash", 173, 63, NS, true, true}, {nullptr, "_", "ro", 185, 63, NS, true, true}, {nullptr, "Right Shift", "rshift", 196, 63, 32, 12, true, true}, {nullptr, "Up", "up", 234, 63, NS, true, true}, {nullptr, "NumPad 1", "num1", 261, 63, NS, true, true}, {nullptr, "NumPad 2", "num2", 273, 63, NS, true, true}, {nullptr, "NumPad 3", "num3", 285, 63, NS, true, true}, {nullptr, "NumPad Enter", "numenter", 297, 69, 12, 24, true, true}, + {nullptr, nullptr, "g16", 0, 75, NS, true, true}, {nullptr, nullptr, "g17", 11, 75, NS, true, true}, {nullptr, nullptr, "g18", 22, 75, NS, true, true}, {nullptr, "Left Ctrl", "lctrl", 40, 75, 16, 12, true, true}, {nullptr, "Left Windows", "lwin", 54, 75, NS, true, true}, {nullptr, "Left Alt", "lalt", 67, 75, 14, 12, true, true}, {nullptr, "無変換", "muhenkan", 80, 75, NS, true, true}, {nullptr, "Space", "space", 116, 75, 84, 12, true, true}, {nullptr, "変換", "henkan", 150, 75, NS, true, true}, {nullptr, "ひらがな カタカナ ローマ字", "katahira", 162, 75, NS, true, true}, {nullptr, "Right Alt", "ralt", 165, 75, 14, 12, true, true}, {nullptr, "Right Windows", "rwin", 178, 75, NS, true, true}, {nullptr, "Menu", "rmenu", 190, 75, NS, true, true}, {nullptr, "Right Ctrl", "rctrl", 204, 75, 16, 12, true, true}, {nullptr, "Left", "left", 222, 75, NS, true, true}, {nullptr, "Down", "down", 234, 75, NS, true, true}, {nullptr, "Right", "right", 246, 75, NS, true, true}, {nullptr, "NumPad 0", "num0", 267, 75, 24, 12, true, true}, {nullptr, "NumPad .", "numdot", 285, 75, NS, true, true} }; #define KEYCOUNT_K95 (sizeof(K95Keys) / sizeof(Key)) @@ -41,19 +41,19 @@ struct KeyPatch { }; static const KeyPatch patchDK[] = { - {0, "§", "grave"}, {0, "+", "minus"}, {0, "´", "equal"}, - {0, "Å", "lbrace"}, {0, "¨", "rbrace"}, - {0, "Æ", "colon"}, {0, "Ø", "quote"}, {0, "'", "hash"}, - {0, "<", "bslash_iso"}, {0, "-", "slash"}, + {nullptr, "§", "grave"}, {nullptr, "+", "minus"}, {nullptr, "´", "equal"}, + {nullptr, "Å", "lbrace"}, {nullptr, "¨", "rbrace"}, + {nullptr, "Æ", "colon"}, {nullptr, "Ø", "quote"}, {nullptr, "'", "hash"}, + {nullptr, "<", "bslash_iso"}, {nullptr, "-", "slash"}, }; static const KeyPatch patchEU[] = { - {0, "\\ (R)", "hash"}, - {0, "\\ (L)", "bslash_iso"}, + {nullptr, "\\ (R)", "hash"}, + {nullptr, "\\ (L)", "bslash_iso"}, }; static const KeyPatch patchFR[] = { - {"sup2", "²", "grave"}, {0, "&", "1"}, {0, "É", "2"}, {0, "\"", "3"}, {0, "'", "4"}, {0, "(", "5"}, {0, "-", "6"}, {0, "È", "7"}, {0, "_", "8"}, {0, "Ç", "9"}, {0, "À", "0"}, {"rparen", ")", "minus"}, + {"sup2", "²", "grave"}, {nullptr, "&", "1"}, {nullptr, "É", "2"}, {nullptr, "\"", "3"}, {nullptr, "'", "4"}, {nullptr, "(", "5"}, {nullptr, "-", "6"}, {nullptr, "È", "7"}, {nullptr, "_", "8"}, {nullptr, "Ç", "9"}, {nullptr, "À", "0"}, {"rparen", ")", "minus"}, {"a", "A", "q"}, {"z", "Z", "w"}, {"caret", "^", "lbrace"}, {"dollar", "$", "rbrace"}, {"q", "Q", "a"}, {"m", "M", "colon"}, {"percent", "Ù", "quote"}, {"star", "*", "hash"}, {"angle", "<", "bslash_iso"}, {"w", "W", "z"}, {"comma", ",", "m"}, {"semicolon", ";", "comma"}, {"colon", ":", "dot"}, {"exclam", "!", "slash"}, @@ -67,24 +67,24 @@ static const KeyPatch patchDE[] = { }; static const KeyPatch patchIT[] = { - {0, "\\", "grave"}, {0, "'", "minus"}, {0, "Ì", "equal"}, - {0, "È", "lbrace"}, {0, "+", "rbrace"}, - {0, "Ò", "colon"}, {0, "À", "quote"}, {0, "Ù", "hash"}, - {0, "<", "bslash_iso"}, {0, "-", "slash"}, + {nullptr, "\\", "grave"}, {nullptr, "'", "minus"}, {nullptr, "Ì", "equal"}, + {nullptr, "È", "lbrace"}, {nullptr, "+", "rbrace"}, + {nullptr, "Ò", "colon"}, {nullptr, "À", "quote"}, {nullptr, "Ù", "hash"}, + {nullptr, "<", "bslash_iso"}, {nullptr, "-", "slash"}, }; static const KeyPatch patchNO[] = { - {0, "§", "grave"}, {0, "+", "minus"}, {0, "´", "equal"}, - {0, "Å", "lbrace"}, {0, "¨", "rbrace"}, - {0, "Ø", "colon"}, {0, "Æ", "quote"}, {0, "'", "hash"}, - {0, "<", "bslash_iso"}, {0, "-", "slash"}, + {nullptr, "§", "grave"}, {nullptr, "+", "minus"}, {nullptr, "´", "equal"}, + {nullptr, "Å", "lbrace"}, {nullptr, "¨", "rbrace"}, + {nullptr, "Ø", "colon"}, {nullptr, "Æ", "quote"}, {nullptr, "'", "hash"}, + {nullptr, "<", "bslash_iso"}, {nullptr, "-", "slash"}, }; static const KeyPatch patchMX[] = { - {0, "|", "grave"}, {0, "'", "minus"}, {0, "¿", "equal"}, - {0, "´", "lbrace"}, {0, "+", "rbrace"}, - {0, "Ñ", "colon"}, {0, "{", "quote"}, {0, "}", "hash"}, - {0, "<", "bslash_iso"}, {0, "-", "slash"}, + {nullptr, "|", "grave"}, {nullptr, "'", "minus"}, {nullptr, "¿", "equal"}, + {nullptr, "´", "lbrace"}, {nullptr, "+", "rbrace"}, + {nullptr, "Ñ", "colon"}, {nullptr, "{", "quote"}, {nullptr, "}", "hash"}, + {nullptr, "<", "bslash_iso"}, {nullptr, "-", "slash"}, }; static const KeyPatch patchPTBR[] = { @@ -114,10 +114,10 @@ static const KeyPatch patchSE[] = { };*/ static const KeyPatch patchDvorak[] = { - {0, "[", "minus"}, {0, "]", "equal"}, - {0, "'", "q"}, {0, ",", "w"}, {0, ".", "e"}, {0, "P", "r"}, {0, "Y", "t"}, {0, "F", "y"}, {0, "G", "u"}, {0, "C", "i"}, {0, "R", "o"}, {0, "L", "p"}, {0, "/", "lbrace"}, {0, "=", "rbrace"}, - {0, "O", "s"}, {0, "E", "d"}, {0, "U", "f"}, {0, "I", "g"}, {0, "D", "h"}, {0, "H", "j"}, {0, "T", "k"}, {0, "N", "l"}, {0, "S", "colon"}, {0, "-", "quote"}, - {0, ";", "z"}, {0, "Q", "x"}, {0, "J", "c"}, {0, "K", "v"}, {0, "X", "b"}, {0, "B", "n"}, {0, "W", "comma"}, {0, "V", "dot"}, {0, "Z", "slash"}, + {nullptr, "[", "minus"}, {nullptr, "]", "equal"}, + {nullptr, "'", "q"}, {nullptr, ",", "w"}, {nullptr, ".", "e"}, {nullptr, "P", "r"}, {nullptr, "Y", "t"}, {nullptr, "F", "y"}, {nullptr, "G", "u"}, {nullptr, "C", "i"}, {nullptr, "R", "o"}, {nullptr, "L", "p"}, {nullptr, "/", "lbrace"}, {nullptr, "=", "rbrace"}, + {nullptr, "O", "s"}, {nullptr, "E", "d"}, {nullptr, "U", "f"}, {nullptr, "I", "g"}, {nullptr, "D", "h"}, {nullptr, "H", "j"}, {nullptr, "T", "k"}, {nullptr, "N", "l"}, {nullptr, "S", "colon"}, {nullptr, "-", "quote"}, + {nullptr, ";", "z"}, {nullptr, "Q", "x"}, {nullptr, "J", "c"}, {nullptr, "K", "v"}, {nullptr, "X", "b"}, {nullptr, "B", "n"}, {nullptr, "W", "comma"}, {nullptr, "V", "dot"}, {nullptr, "Z", "slash"}, }; // Apply a patch to a key map @@ -243,24 +243,24 @@ static inline void patchABNT2(QHash& map){ static const Key K68TopRow[] = { - {0, "Volume Down", "voldn", 285 - K70_X_START, 0, 13, 8, true, true}, {0, "Volume Up", "volup", 297 - K70_X_START, 0, 13, 8, true, true}, + {nullptr, "Volume Down", "voldn", 285 - K70_X_START, 0, 13, 8, true, true}, {nullptr, "Volume Up", "volup", 297 - K70_X_START, 0, 13, 8, true, true}, }; #define K68_TOP_COUNT (sizeof(K68TopRow) / sizeof(Key)) static const Key K65TopRow[] = { - {0, "Brightness", "light", 164 - K70_X_START, 0, 12, 12, true, true}, {0, "Mute", "mute", 176 - K70_X_START, 0, 12, 12, true, true}, {0, "Volume Down", "voldn", 192 - K70_X_START, 0, 14, 8, true, true}, {0, "Volume Up", "volup", 205 - K70_X_START, 0, 14, 8, true, true}, {0, "Windows Lock", "lock", 222 - K70_X_START, 0, 12, 12, true, true} + {nullptr, "Brightness", "light", 164 - K70_X_START, 0, 12, 12, true, true}, {nullptr, "Mute", "mute", 176 - K70_X_START, 0, 12, 12, true, true}, {nullptr, "Volume Down", "voldn", 192 - K70_X_START, 0, 14, 8, true, true}, {nullptr, "Volume Up", "volup", 205 - K70_X_START, 0, 14, 8, true, true}, {nullptr, "Windows Lock", "lock", 222 - K70_X_START, 0, 12, 12, true, true} }; #define K65_TOP_COUNT (sizeof(K65TopRow) / sizeof(Key)) static const Key K63TopRow[] = { - {0, "Stop", "stop", K70_X_START - 37, 0, 12, 8, true, true}, {0, "Previous", "prev", K70_X_START - 26, 0, 12, 8, true, true}, {0, "Play/Pause", "play", K70_X_START - 15, 0, 12, 8, true, true}, {0, "Next", "next", K70_X_START - 4, 0, 12, 8, true, true}, {0, "Brightness", "light", 170 - K70_X_START, 0, 12, 12, true, true}, {0, "Windows Lock", "lock", 180 - K70_X_START, 0, 12, 12, true, true}, {0, "Mute", "mute", 222 - K70_X_START, 0, 13, 8, true, true}, {0, "Volume Down", "voldn", 234 - K70_X_START, 0, 13, 8, true, true}, {0, "Volume Up", "volup", 246 - K70_X_START, 0, 13, 8, true, true} + {nullptr, "Stop", "stop", K70_X_START - 37, 0, 12, 8, true, true}, {nullptr, "Previous", "prev", K70_X_START - 26, 0, 12, 8, true, true}, {nullptr, "Play/Pause", "play", K70_X_START - 15, 0, 12, 8, true, true}, {nullptr, "Next", "next", K70_X_START - 4, 0, 12, 8, true, true}, {nullptr, "Brightness", "light", 170 - K70_X_START, 0, 12, 12, true, true}, {nullptr, "Windows Lock", "lock", 180 - K70_X_START, 0, 12, 12, true, true}, {nullptr, "Mute", "mute", 222 - K70_X_START, 0, 13, 8, true, true}, {nullptr, "Volume Down", "voldn", 234 - K70_X_START, 0, 13, 8, true, true}, {nullptr, "Volume Up", "volup", 246 - K70_X_START, 0, 13, 8, true, true} }; #define K63_TOP_COUNT (sizeof(K63TopRow) / sizeof(Key)) static const Key K55Zones[] = { - {0, "Zone 1", "zone1", 46, 45, ZS, true, false}, - {0, "Zone 2", "zone2", 140, 45, ZS, true, false}, - {0, "Zone 3", "zone3", 233, 45, ZS, true, false}, + {nullptr, "Zone 1", "zone1", 46, 45, ZS, true, false}, + {nullptr, "Zone 2", "zone2", 140, 45, ZS, true, false}, + {nullptr, "Zone 3", "zone3", 233, 45, ZS, true, false}, }; #define K55_ZONES (sizeof(K55Zones) / sizeof(Key)) @@ -271,19 +271,19 @@ static const Key K55Zones[] = { #define KSTRAFE_HEIGHT K95_HEIGHT static const Key KStrafeKeys[] = { - {0, "Sidelight", "lsidel", 0, KSTRAFE_HEIGHT/2, KSTRAFE_X_START, KSTRAFE_HEIGHT, true, false}, - {0, "Sidelight", "rsidel", KSTRAFE_WIDTH, KSTRAFE_HEIGHT/2, KSTRAFE_X_START, KSTRAFE_HEIGHT, true, false}, - {0, "Logo", "logo", KSTRAFE_X_START, 0, NS, true, false}, - {0, "Function", "fn", 152, 75, NS, true, true} + {nullptr, "Sidelight", "lsidel", 0, KSTRAFE_HEIGHT/2, KSTRAFE_X_START, KSTRAFE_HEIGHT, true, false}, + {nullptr, "Sidelight", "rsidel", KSTRAFE_WIDTH, KSTRAFE_HEIGHT/2, KSTRAFE_X_START, KSTRAFE_HEIGHT, true, false}, + {nullptr, "Logo", "logo", KSTRAFE_X_START, 0, NS, true, false}, + {nullptr, "Function", "fn", 152, 75, NS, true, true} }; // Mouse map - M65 static const Key M65Keys[] = { - {0, "Left Mouse", "mouse1", 8, 0, 14, 32, false, true}, {0, "Right Mouse", "mouse2", 30, 0, 14, 32, false, true}, {0, "Middle Mouse", "mouse3", 22, 8, 8, 7, false, true}, - {0, "Wheel Up", "wheelup", 22, 4, 8, 5, false, true}, {0, "Wheel Down", "wheeldn", 22, 14, 8, 5, false, true}, {0, "Wheel Light", "front", 22, 15, 8, 8, true, false}, - {0, "DPI Up", "dpiup", 22, 19, 8, 6, false, true}, {0, "DPI Light", "dpi", 22, 24, 8, 8, true, false}, {0, "DPI Down", "dpidn", 22, 31, 8, 6, false, true}, - {0, "Forward", "mouse5", 5, 24, 5, 9, false, true}, {0, "Back", "mouse4", 5, 33, 5, 10, false, true}, {0, "Sniper", "sniper", 0, 25, 5, 15, false, true}, - {0, "Logo", "back", 14, 55, 24, 12, true, false} + {nullptr, "Left Mouse", "mouse1", 8, 0, 14, 32, false, true}, {nullptr, "Right Mouse", "mouse2", 30, 0, 14, 32, false, true}, {nullptr, "Middle Mouse", "mouse3", 22, 8, 8, 7, false, true}, + {nullptr, "Wheel Up", "wheelup", 22, 4, 8, 5, false, true}, {nullptr, "Wheel Down", "wheeldn", 22, 14, 8, 5, false, true}, {nullptr, "Wheel Light", "front", 22, 15, 8, 8, true, false}, + {nullptr, "DPI Up", "dpiup", 22, 19, 8, 6, false, true}, {nullptr, "DPI Light", "dpi", 22, 24, 8, 8, true, false}, {nullptr, "DPI Down", "dpidn", 22, 31, 8, 6, false, true}, + {nullptr, "Forward", "mouse5", 5, 24, 5, 9, false, true}, {nullptr, "Back", "mouse4", 5, 33, 5, 10, false, true}, {nullptr, "Sniper", "sniper", 0, 25, 5, 15, false, true}, + {nullptr, "Logo", "back", 14, 55, 24, 12, true, false} }; #define KEYCOUNT_M65 (sizeof(M65Keys) / sizeof(Key)) @@ -292,11 +292,11 @@ static const Key M65Keys[] = { // Sabre static const Key SabreKeys[] = { - {0, "Left Mouse", "mouse1", 8, 0, 14, 32, false, true}, {0, "Right Mouse", "mouse2", 30, 0, 14, 32, false, true}, {0, "Middle Mouse", "mouse3", 22, 9, 8, 7, false, true}, {0, "Front light", "front", 8, -2, 14, 8, true, false }, - {0, "Wheel Up", "wheelup", 22, 5, 8, 5, false, true}, {0, "Wheel Down", "wheeldn", 22, 15, 8, 5, false, true}, {0, "Wheel Light", "wheel", 22, 5, 8, 15, true, false}, {0, "Extra button", "thumb1", 22, 20, 8, 18, false, true}, - {0, "DPI Up", "dpiup", 5, 3, 5, 7, false, true}, {0, "DPI Down", "dpidn", 5, 10, 5, 7, false, true}, {0, "DPI Light", "dpi", 5, 4, 5, 12, true, false}, - {0, "Forward", "mouse5", 5, 24, 5, 9, false, true}, {0, "Back", "mouse4", 5, 33, 5, 10, false, true}, - {0, "Logo", "back", 14, 50, 24, 12, true, false} + {nullptr, "Left Mouse", "mouse1", 8, 0, 14, 32, false, true}, {nullptr, "Right Mouse", "mouse2", 30, 0, 14, 32, false, true}, {nullptr, "Middle Mouse", "mouse3", 22, 9, 8, 7, false, true}, {nullptr, "Front light", "front", 8, -2, 14, 8, true, false }, + {nullptr, "Wheel Up", "wheelup", 22, 5, 8, 5, false, true}, {nullptr, "Wheel Down", "wheeldn", 22, 15, 8, 5, false, true}, {nullptr, "Wheel Light", "wheel", 22, 5, 8, 15, true, false}, {nullptr, "Extra button", "thumb1", 22, 20, 8, 18, false, true}, + {nullptr, "DPI Up", "dpiup", 5, 3, 5, 7, false, true}, {nullptr, "DPI Down", "dpidn", 5, 10, 5, 7, false, true}, {nullptr, "DPI Light", "dpi", 5, 4, 5, 12, true, false}, + {nullptr, "Forward", "mouse5", 5, 24, 5, 9, false, true}, {nullptr, "Back", "mouse4", 5, 33, 5, 10, false, true}, + {nullptr, "Logo", "back", 14, 50, 24, 12, true, false} }; #define KEYCOUNT_SABRE (sizeof(SabreKeys) / sizeof(Key)) @@ -305,10 +305,10 @@ static const Key SabreKeys[] = { // Harpoon static const Key HarpoonKeys[] = { - {0, "Left Mouse", "mouse1", 10, 5, 14, 26, false, true}, {0, "Right Mouse", "mouse2", 30, 5, 14, 26, false, true}, {0, "Middle Mouse", "mouse3", 25, 11, 6, 7, false, true}, - {0, "Wheel Up", "wheelup", 25, 7, 6, 5, false, true}, {0, "Wheel Down", "wheeldn", 25, 17, 6, 5, false, true}, - {0, "DPI Cycle", "dpiup", 25, 23, 6, 10, false, true}, {0, "Logo Light", "dpi", 18, 40, 20, 20, true, false}, - {0, "Forward", "mouse5", 3, 24, 5, 10, false, true}, {0, "Back", "mouse4", 3, 33, 5, 10, false, true} + {nullptr, "Left Mouse", "mouse1", 10, 5, 14, 26, false, true}, {nullptr, "Right Mouse", "mouse2", 30, 5, 14, 26, false, true}, {nullptr, "Middle Mouse", "mouse3", 25, 11, 6, 7, false, true}, + {nullptr, "Wheel Up", "wheelup", 25, 7, 6, 5, false, true}, {nullptr, "Wheel Down", "wheeldn", 25, 17, 6, 5, false, true}, + {nullptr, "DPI Cycle", "dpiup", 25, 23, 6, 10, false, true}, {nullptr, "Logo Light", "dpi", 18, 40, 20, 20, true, false}, + {nullptr, "Forward", "mouse5", 3, 24, 5, 10, false, true}, {nullptr, "Back", "mouse4", 3, 33, 5, 10, false, true} }; #define KEYCOUNT_HARPOON (sizeof(HarpoonKeys) / sizeof(Key)) @@ -317,10 +317,10 @@ static const Key HarpoonKeys[] = { // Glaive static const Key GlaiveKeys[] = { - {0, "Left Mouse", "mouse1", 17, 3, 14, 18, false, true}, {0, "Right Mouse", "mouse2", 37, 3, 14, 18, false, true}, {0, "Middle Mouse", "mouse3", 31, 9, 7, 7, false, true}, {0, "Front light", "front", 16, -5, 36, 8, true, false }, - {0, "Wheel Up", "wheelup", 31, 5, 7, 5, false, true}, {0, "Wheel Down", "wheeldn", 31, 15, 7, 5, false, true}, {0, "Side Lights", "side", 22, 24, 7, 20, true, false}, - {0, "DPI Cycle", "dpiup", 31, 19, 6, 12, false, true}, {0, "Logo Light", "back", 24, 43, 20, 20, true, false}, - {0, "Forward", "mouse5", 15, 22, 5, 11, false, true}, {0, "Back", "mouse4", 15, 32, 5, 11, false, true} + {nullptr, "Left Mouse", "mouse1", 17, 3, 14, 18, false, true}, {nullptr, "Right Mouse", "mouse2", 37, 3, 14, 18, false, true}, {nullptr, "Middle Mouse", "mouse3", 31, 9, 7, 7, false, true}, {nullptr, "Front light", "front", 16, -5, 36, 8, true, false }, + {nullptr, "Wheel Up", "wheelup", 31, 5, 7, 5, false, true}, {nullptr, "Wheel Down", "wheeldn", 31, 15, 7, 5, false, true}, {nullptr, "Side Lights", "side", 22, 24, 7, 20, true, false}, + {nullptr, "DPI Cycle", "dpiup", 31, 19, 6, 12, false, true}, {nullptr, "Logo Light", "back", 24, 43, 20, 20, true, false}, + {nullptr, "Forward", "mouse5", 15, 22, 5, 11, false, true}, {nullptr, "Back", "mouse4", 15, 32, 5, 11, false, true} }; #define KEYCOUNT_GLAIVE (sizeof(GlaiveKeys) / sizeof(Key)) @@ -329,37 +329,37 @@ static const Key GlaiveKeys[] = { // Katar static const Key KatarKeys[] = { - {0, "Left Mouse", "mouse1", 7, 4, 14, 18, false, true}, {0, "Right Mouse", "mouse2", 28, 4, 14, 18, false, true}, {0, "Middle Mouse", "mouse3", 22, 9, 7, 7, false, true}, - {0, "Wheel Up", "wheelup", 22, 5, 7, 5, false, true}, {0, "Wheel Down", "wheeldn", 22, 15, 7, 5, false, true}, - {0, "DPI Cycle", "dpiup", 22, 19, 6, 12, false, true}, {0, "Logo Light", "front", 15, 43, 20, 20, true, false}, + {nullptr, "Left Mouse", "mouse1", 7, 4, 14, 18, false, true}, {nullptr, "Right Mouse", "mouse2", 28, 4, 14, 18, false, true}, {nullptr, "Middle Mouse", "mouse3", 22, 9, 7, 7, false, true}, + {nullptr, "Wheel Up", "wheelup", 22, 5, 7, 5, false, true}, {nullptr, "Wheel Down", "wheeldn", 22, 15, 7, 5, false, true}, + {nullptr, "DPI Cycle", "dpiup", 22, 19, 6, 12, false, true}, {nullptr, "Logo Light", "front", 15, 43, 20, 20, true, false}, }; #define KEYCOUNT_KATAR (sizeof(KatarKeys) / sizeof(Key)) // Katar PRO XT static const Key KatarPROXTKeys[] = { - {0, "Left Mouse", "mouse1", 7, 4, 14, 18, false, true}, - {0, "Right Mouse", "mouse2", 28, 4, 14, 18, false, true}, - {0, "Middle Mouse", "mouse3", 22, 9, 7, 7, false, true}, - {0, "Wheel Up", "wheelup", 22, 5, 7, 5, false, true}, - {0, "Wheel Down", "wheeldn", 22, 15, 7, 5, false, true}, - {0, "DPI Cycle", "dpiup", 22, 19, 6, 12, false, true}, - {0, "DPI Wheel Light", "dpi", 21, 3, 8, 14, true, false}, - {0, "Forward", "mouse5", 3, 24, 5, 10, false, true}, - {0, "Back", "mouse4", 3, 33, 5, 10, false, true} + {nullptr, "Left Mouse", "mouse1", 7, 4, 14, 18, false, true}, + {nullptr, "Right Mouse", "mouse2", 28, 4, 14, 18, false, true}, + {nullptr, "Middle Mouse", "mouse3", 22, 9, 7, 7, false, true}, + {nullptr, "Wheel Up", "wheelup", 22, 5, 7, 5, false, true}, + {nullptr, "Wheel Down", "wheeldn", 22, 15, 7, 5, false, true}, + {nullptr, "DPI Cycle", "dpiup", 22, 19, 6, 12, false, true}, + {nullptr, "DPI Wheel Light", "dpi", 21, 3, 8, 14, true, false}, + {nullptr, "Forward", "mouse5", 3, 24, 5, 10, false, true}, + {nullptr, "Back", "mouse4", 3, 33, 5, 10, false, true} }; #define KEYCOUNT_KATAR_PROXT (sizeof(KatarPROXTKeys) / sizeof(Key)) // Scimitar static const Key ScimKeys[] = { - {0, "Left Mouse", "mouse1", 15, 0, 14, 32, false, true}, {0, "Right Mouse", "mouse2", 37, 0, 12, 32, false, true}, {0, "Middle Mouse", "mouse3", 29, 9, 8, 6, false, true}, {0, "Front light", "front", 37, 0, 12, 8, true, false }, - {0, "Wheel Up", "wheelup", 29, 3, 8, 6, false, true}, {0, "Wheel Down", "wheeldn", 29, 14, 8, 6, false, true}, {0, "Wheel Light", "wheel", 29, 3, 8, 17, true, false}, - {0, "DPI Up", "dpiup", 29, 19, 8, 9, false, true}, {0, "DPI Light", "dpi", 8, 12, 8, 4, true, false}, {0, "DPI Down", "dpidn", 29, 28, 8, 9, false, true}, - {0, "Thumb light", "thumb", 7, 21, 10, 24, true, false}, - {0, "1", "thumb1", -6, 18, 7, 7, false, true}, {0, "2", "thumb2", 1, 18, 7, 7, false, true}, {0, "3", "thumb3", 8, 18, 7, 7, false, true}, - {0, "4", "thumb4", -6, 25, 7, 7, false, true}, {0, "5", "thumb5", 1, 25, 7, 7, false, true}, {0, "6", "thumb6", 8, 25, 7, 7, false, true}, - {0, "7", "thumb7", -6, 32, 7, 7, false, true}, {0, "8", "thumb8", 1, 32, 7, 7, false, true}, {0, "9", "thumb9", 8, 32, 7, 7, false, true}, - {0, "10", "thumb10", -6, 39, 7, 7, false, true}, {0, "11", "thumb11", 1, 39, 7, 7, false, true}, {0, "12", "thumb12", 8, 39, 7, 7, false, true}, - {0, "Logo", "back", 21, 50, 24, 16, true, false} + {nullptr, "Left Mouse", "mouse1", 15, 0, 14, 32, false, true}, {nullptr, "Right Mouse", "mouse2", 37, 0, 12, 32, false, true}, {nullptr, "Middle Mouse", "mouse3", 29, 9, 8, 6, false, true}, {nullptr, "Front light", "front", 37, 0, 12, 8, true, false }, + {nullptr, "Wheel Up", "wheelup", 29, 3, 8, 6, false, true}, {nullptr, "Wheel Down", "wheeldn", 29, 14, 8, 6, false, true}, {nullptr, "Wheel Light", "wheel", 29, 3, 8, 17, true, false}, + {nullptr, "DPI Up", "dpiup", 29, 19, 8, 9, false, true}, {nullptr, "DPI Light", "dpi", 8, 12, 8, 4, true, false}, {nullptr, "DPI Down", "dpidn", 29, 28, 8, 9, false, true}, + {nullptr, "Thumb light", "thumb", 7, 21, 10, 24, true, false}, + {nullptr, "1", "thumb1", -6, 18, 7, 7, false, true}, {nullptr, "2", "thumb2", 1, 18, 7, 7, false, true}, {nullptr, "3", "thumb3", 8, 18, 7, 7, false, true}, + {nullptr, "4", "thumb4", -6, 25, 7, 7, false, true}, {nullptr, "5", "thumb5", 1, 25, 7, 7, false, true}, {nullptr, "6", "thumb6", 8, 25, 7, 7, false, true}, + {nullptr, "7", "thumb7", -6, 32, 7, 7, false, true}, {nullptr, "8", "thumb8", 1, 32, 7, 7, false, true}, {nullptr, "9", "thumb9", 8, 32, 7, 7, false, true}, + {nullptr, "10", "thumb10", -6, 39, 7, 7, false, true}, {nullptr, "11", "thumb11", 1, 39, 7, 7, false, true}, {nullptr, "12", "thumb12", 8, 39, 7, 7, false, true}, + {nullptr, "Logo", "back", 21, 50, 24, 16, true, false} }; #define KEYCOUNT_SCIM (sizeof(ScimKeys) / sizeof(Key)) @@ -368,14 +368,14 @@ static const Key ScimKeys[] = { // M95 static const Key M95Keys[] = { - {0, "Left Mouse", "mouse1", 42, 6, 14, 26, false, true}, {0, "Right Mouse", "mouse2", 63, 6, 14, 26, false, true}, {0, "Middle Mouse", "mouse3", 55, 8, 8, 7, false, true}, - {0, "4", "thumb6", 56, 28, 7, 12, false, true}, - {0, "Wheel Up", "wheelup", 55, 4, 8, 5, false, true}, {0, "Wheel Down", "wheeldn", 55, 14, 8, 5, false, true}, {0, "DPI Up (5)", "dpiup", 38, -1, 6, 9, false, true}, {0, "DPI Down (6)", "dpidn", 38, 6, 6, 9, false, true}, - {0, "Forward (7)", "mouse6", -9, 14, 14, 8, false, true}, {0, "Back (8)", "mouse7", 3, 14, 14, 8, false, true}, {0, "Sniper (14)", "sniper", -6, 20, 8, 14, false, true}, - {0, "9", "thumb1", 15, 14, 18, 8, false, true}, {0, "15", "thumb7", 15, 20, 10, 22, false, true}, - {0, "10", "thumb2", 23, 20, 10, 12, false, true},{0, "11", "thumb3", 23, 30, 10, 12, false, true}, - {0, "12", "thumb4", 15, 40, 18, 8, false, true}, {0, "13", "thumb5", -1, 40, 18, 8, false, true}, - {0, "Logo", "back", 53, 55, 12, 12, true, false} + {nullptr, "Left Mouse", "mouse1", 42, 6, 14, 26, false, true}, {nullptr, "Right Mouse", "mouse2", 63, 6, 14, 26, false, true}, {nullptr, "Middle Mouse", "mouse3", 55, 8, 8, 7, false, true}, + {nullptr, "4", "thumb6", 56, 28, 7, 12, false, true}, + {nullptr, "Wheel Up", "wheelup", 55, 4, 8, 5, false, true}, {nullptr, "Wheel Down", "wheeldn", 55, 14, 8, 5, false, true}, {nullptr, "DPI Up (5)", "dpiup", 38, -1, 6, 9, false, true}, {nullptr, "DPI Down (6)", "dpidn", 38, 6, 6, 9, false, true}, + {nullptr, "Forward (7)", "mouse6", -9, 14, 14, 8, false, true}, {nullptr, "Back (8)", "mouse7", 3, 14, 14, 8, false, true}, {nullptr, "Sniper (14)", "sniper", -6, 20, 8, 14, false, true}, + {nullptr, "9", "thumb1", 15, 14, 18, 8, false, true}, {nullptr, "15", "thumb7", 15, 20, 10, 22, false, true}, + {nullptr, "10", "thumb2", 23, 20, 10, 12, false, true},{nullptr, "11", "thumb3", 23, 30, 10, 12, false, true}, + {nullptr, "12", "thumb4", 15, 40, 18, 8, false, true}, {nullptr, "13", "thumb5", -1, 40, 18, 8, false, true}, + {nullptr, "Logo", "back", 53, 55, 12, 12, true, false} }; #define KEYCOUNT_M95 (sizeof(M95Keys) / sizeof(Key)) @@ -384,37 +384,37 @@ static const Key M95Keys[] = { // M55 static const Key M55Keys[] = { - {0, "Left Mouse", "mouse1", 8, 4, 14, 18, false, true}, - {0, "Right Mouse", "mouse2", 31, 4, 14, 18, false, true}, - {0, "Middle Mouse", "mouse3", 24, 6, 7, 8, false, true}, - {0, "Wheel Up", "wheelup", 24, 3, 7, 5, false, true}, - {0, "Wheel Down", "wheeldn", 24, 13, 7, 5, false, true}, - {0, "DPI Cycle", "dpiup", 24, 19, 6, 10, false, true}, - {0, "DPI Light", "dpi", 23, 15, 8, 6, true, false}, - {0, "Forward", "mouse4", 6, 24, 5, 10, false, true}, - {0, "Back", "mouse5", 6, 33, 5, 10, false, true}, - {0, "Forward (7)", "mouse6", 43, 24, 5, 10, false, true}, - {0, "Back (8)", "mouse7", 43, 33, 5, 10, false, true}, - {0, "Logo", "back", 21, 50, 12, 12, true, false} + {nullptr, "Left Mouse", "mouse1", 8, 4, 14, 18, false, true}, + {nullptr, "Right Mouse", "mouse2", 31, 4, 14, 18, false, true}, + {nullptr, "Middle Mouse", "mouse3", 24, 6, 7, 8, false, true}, + {nullptr, "Wheel Up", "wheelup", 24, 3, 7, 5, false, true}, + {nullptr, "Wheel Down", "wheeldn", 24, 13, 7, 5, false, true}, + {nullptr, "DPI Cycle", "dpiup", 24, 19, 6, 10, false, true}, + {nullptr, "DPI Light", "dpi", 23, 15, 8, 6, true, false}, + {nullptr, "Forward", "mouse4", 6, 24, 5, 10, false, true}, + {nullptr, "Back", "mouse5", 6, 33, 5, 10, false, true}, + {nullptr, "Forward (7)", "mouse6", 43, 24, 5, 10, false, true}, + {nullptr, "Back (8)", "mouse7", 43, 33, 5, 10, false, true}, + {nullptr, "Logo", "back", 21, 50, 12, 12, true, false} }; #define KEYCOUNT_M55 (sizeof(M55Keys) / sizeof(Key)) // K95 Platinum lightbar static const Key K95PLbar[] = { - {0, 0, "topbar1", 4, -3, LBS, true, false}, {0, 0, "topbar2", 19, -3, LBS, true, false}, {0, 0, "topbar3", 34, -3, LBS, true, false}, {0, 0, "topbar4", 49, -3, LBS, true, false}, {0, 0, "topbar5", 64, -3, LBS, true, false}, {0, 0, "topbar6", 79, -3, LBS, true, false}, - {0, 0, "topbar7", 94, -3, LBS, true, false}, {0, 0, "topbar8", 109, -3, LBS, true, false}, {0, 0, "topbar9", 124, -3, LBS, true, false}, {0, 0, "topbar10", 139, -3, LBS, true, false}, {0, 0, "topbar11", 154, -3, LBS, true, false}, {0, 0, "topbar12", 169, -3, LBS, true, false}, - {0, 0, "topbar13", 184, -3, LBS, true, false}, {0, 0, "topbar14", 199, -3, LBS, true, false}, {0, 0, "topbar15", 214, -3, LBS, true, false}, {0, 0, "topbar16", 229, -3, LBS, true, false}, {0, 0, "topbar17", 244, -3, LBS, true, false}, {0, 0, "topbar18", 259, -3, LBS, true, false}, - {0, 0, "topbar19", 274, -3, LBS, true, false}, + {nullptr, nullptr, "topbar1", 4, -3, LBS, true, false}, {nullptr, nullptr, "topbar2", 19, -3, LBS, true, false}, {nullptr, nullptr, "topbar3", 34, -3, LBS, true, false}, {nullptr, nullptr, "topbar4", 49, -3, LBS, true, false}, {nullptr, nullptr, "topbar5", 64, -3, LBS, true, false}, {nullptr, nullptr, "topbar6", 79, -3, LBS, true, false}, + {nullptr, nullptr, "topbar7", 94, -3, LBS, true, false}, {nullptr, nullptr, "topbar8", 109, -3, LBS, true, false}, {nullptr, nullptr, "topbar9", 124, -3, LBS, true, false}, {nullptr, nullptr, "topbar10", 139, -3, LBS, true, false}, {nullptr, nullptr, "topbar11", 154, -3, LBS, true, false}, {nullptr, nullptr, "topbar12", 169, -3, LBS, true, false}, + {nullptr, nullptr, "topbar13", 184, -3, LBS, true, false}, {nullptr, nullptr, "topbar14", 199, -3, LBS, true, false}, {nullptr, nullptr, "topbar15", 214, -3, LBS, true, false}, {nullptr, nullptr, "topbar16", 229, -3, LBS, true, false}, {nullptr, nullptr, "topbar17", 244, -3, LBS, true, false}, {nullptr, nullptr, "topbar18", 259, -3, LBS, true, false}, + {nullptr, nullptr, "topbar19", 274, -3, LBS, true, false}, }; #define LBARCOUNT_K95P (sizeof(K95PLbar) / sizeof(Key)) // Mouse map - DARK CORE static const Key DarkCoreKeys[] = { - {0, "Left Mouse", "mouse1", 8, 0, 14, 32, false, true}, {0, "Right Mouse", "mouse2", 30, 0, 14, 32, false, true}, {0, "Middle Mouse", "mouse3", 22, 8, 8, 7, false, true}, - {0, "Wheel Up", "wheelup", 22, 4, 8, 5, false, true}, {0, "Wheel Down", "wheeldn", 22, 14, 8, 5, false, true}, {0, "Wheel Light", "wheel", 22, 2, 8, 16, true, false}, - {0, "DPI Up", "dpiup", 0, 5, 8, 8, false, true}, {0, "DPI Down", "dpidn", 0, 12, 8, 8, false, true}, - {0, "Forward", "mouse5", 5, 24, 5, 9, false, true}, {0, "Back", "mouse4", 5, 33, 5, 10, false, true}, {0, "Sniper", "sniper", 0, 25, 5, 15, false, true}, {0, "Side light", "side", 0, 24, 10, 24, true, false}, - {0, "Logo", "back", 0, 48, 48, 12, true, false}, {0, "Profile Switch", "profswitch", 22, 20, 8, 12, false, true}, {0, "DPI", "dpi", 0, 0, 10, 24, true, false } + {nullptr, "Left Mouse", "mouse1", 8, 0, 14, 32, false, true}, {nullptr, "Right Mouse", "mouse2", 30, 0, 14, 32, false, true}, {nullptr, "Middle Mouse", "mouse3", 22, 8, 8, 7, false, true}, + {nullptr, "Wheel Up", "wheelup", 22, 4, 8, 5, false, true}, {nullptr, "Wheel Down", "wheeldn", 22, 14, 8, 5, false, true}, {nullptr, "Wheel Light", "wheel", 22, 2, 8, 16, true, false}, + {nullptr, "DPI Up", "dpiup", 0, 5, 8, 8, false, true}, {nullptr, "DPI Down", "dpidn", 0, 12, 8, 8, false, true}, + {nullptr, "Forward", "mouse5", 5, 24, 5, 9, false, true}, {nullptr, "Back", "mouse4", 5, 33, 5, 10, false, true}, {nullptr, "Sniper", "sniper", 0, 25, 5, 15, false, true}, {nullptr, "Side light", "side", 0, 24, 10, 24, true, false}, + {nullptr, "Logo", "back", 0, 48, 48, 12, true, false}, {nullptr, "Profile Switch", "profswitch", 22, 20, 8, 12, false, true}, {nullptr, "DPI", "dpi", 0, 0, 10, 24, true, false } }; #define KEYCOUNT_DARKCORE (sizeof(DarkCoreKeys) / sizeof(Key)) @@ -423,10 +423,10 @@ static const Key DarkCoreKeys[] = { #define POLARIS_H 14, 6 static const Key PolarisZones[] = { - {0, "Zone 1", "zone1", 65, 4, POLARIS_V, true, false}, {0, "Zone 2", "zone2", 65, 16, POLARIS_V, true, false}, {0, "Zone 3", "zone3", 65, 28, POLARIS_V, true, false}, {0, "Zone 4", "zone4", 65, 40, POLARIS_V, true, false}, - {0, "Zone 5", "zone5", 65, 52, POLARIS_V, true, false}, {0, "Zone 6", "zone6", 43, 62, POLARIS_H, true, false}, {0, "Zone 7", "zone7", 31, 62, POLARIS_H, true, false}, {0, "Zone 8", "zone8", 19, 62, POLARIS_H, true, false}, - {0, "Zone 9", "zone9", 7, 62, POLARIS_H, true, false}, {0, "Zone 10", "zone10", -5, 62, POLARIS_H, true, false}, {0, "Zone 11", "zone11", -19, 52, POLARIS_V, true, false}, {0, "Zone 12", "zone12", -19, 40, POLARIS_V, true, false}, - {0, "Zone 13", "zone13", -19, 28, POLARIS_V, true, false}, {0, "Zone 14", "zone14", -19, 16, POLARIS_V, true, false}, {0, "Zone 15", "zone15", -19, 4, POLARIS_V, true, false} + {nullptr, "Zone 1", "zone1", 65, 4, POLARIS_V, true, false}, {nullptr, "Zone 2", "zone2", 65, 16, POLARIS_V, true, false}, {nullptr, "Zone 3", "zone3", 65, 28, POLARIS_V, true, false}, {nullptr, "Zone 4", "zone4", 65, 40, POLARIS_V, true, false}, + {nullptr, "Zone 5", "zone5", 65, 52, POLARIS_V, true, false}, {nullptr, "Zone 6", "zone6", 43, 62, POLARIS_H, true, false}, {nullptr, "Zone 7", "zone7", 31, 62, POLARIS_H, true, false}, {nullptr, "Zone 8", "zone8", 19, 62, POLARIS_H, true, false}, + {nullptr, "Zone 9", "zone9", 7, 62, POLARIS_H, true, false}, {nullptr, "Zone 10", "zone10", -5, 62, POLARIS_H, true, false}, {nullptr, "Zone 11", "zone11", -19, 52, POLARIS_V, true, false}, {nullptr, "Zone 12", "zone12", -19, 40, POLARIS_V, true, false}, + {nullptr, "Zone 13", "zone13", -19, 28, POLARIS_V, true, false}, {nullptr, "Zone 14", "zone14", -19, 16, POLARIS_V, true, false}, {nullptr, "Zone 15", "zone15", -19, 4, POLARIS_V, true, false} }; #define KEYCOUNT_POLARIS (sizeof(PolarisZones) / sizeof(Key)) @@ -434,36 +434,36 @@ static const Key PolarisZones[] = { #define ST100_H 22,6 static const Key ST100Zones[] = { - {0, "Zone 1", "zone1", 16, 10, ST100_H, true, false}, {0, "Zone 2", "zone2", 36, 10, ST100_H, true, false}, {0, "Zone 3", "zone3", 52, 30, ST100_V, true, false}, {0, "Zone 4", "zone4", 52, 50, ST100_V, true, false}, - {0, "Logo", "zone5", 21, -1, NS, true, false}, // Logo - {0, "Zone 6", "zone6", 16, 66, ST100_H, true, false}, {0, "Zone 7", "zone7", -4, 50, ST100_V, true, false}, {0, "Zone 8", "zone8", -4, 30, ST100_V, true, false}, - {0, "Zone 9", "zone9", -4, 10, ST100_H, true, false}, + {nullptr, "Zone 1", "zone1", 16, 10, ST100_H, true, false}, {nullptr, "Zone 2", "zone2", 36, 10, ST100_H, true, false}, {nullptr, "Zone 3", "zone3", 52, 30, ST100_V, true, false}, {nullptr, "Zone 4", "zone4", 52, 50, ST100_V, true, false}, + {nullptr, "Logo", "zone5", 21, -1, NS, true, false}, // Logo + {nullptr, "Zone 6", "zone6", 16, 66, ST100_H, true, false}, {nullptr, "Zone 7", "zone7", -4, 50, ST100_V, true, false}, {nullptr, "Zone 8", "zone8", -4, 30, ST100_V, true, false}, + {nullptr, "Zone 9", "zone9", -4, 10, ST100_H, true, false}, }; #define KEYCOUNT_ST100 (sizeof(ST100Zones) / sizeof(Key)) // Mouse map - Ironclaw static const Key IronclawKeys[] = { // primary keys - {0, "Left Mouse", "mouse1", 12, 0, 12, 28, false, true }, - {0, "Right Mouse", "mouse2", 31, 0, 12, 28, false, true }, + {nullptr, "Left Mouse", "mouse1", 12, 0, 12, 28, false, true }, + {nullptr, "Right Mouse", "mouse2", 31, 0, 12, 28, false, true }, // center column keys - {0, "Wheel Up", "wheelup", 23, 3, 8, 7, false, true }, - {0, "Middle Mouse", "mouse3", 23, 7, 8, 6, false, true }, - {0, "Wheel Down", "wheeldn", 23, 12, 8, 7, false, true }, - {0, "Profile Cycle", "profswitch", 23, 18, 9, 9, false, true }, - {0, "DPI Cycle", "dpiup", 23, 26, 8, 9, false, true }, + {nullptr, "Wheel Up", "wheelup", 23, 3, 8, 7, false, true }, + {nullptr, "Middle Mouse", "mouse3", 23, 7, 8, 6, false, true }, + {nullptr, "Wheel Down", "wheeldn", 23, 12, 8, 7, false, true }, + {nullptr, "Profile Cycle", "profswitch", 23, 18, 9, 9, false, true }, + {nullptr, "DPI Cycle", "dpiup", 23, 26, 8, 9, false, true }, // left side forward/back keys - {0, "Forward", "mouse5", 6, 20, 5, 12, false, true }, - {0, "Back", "mouse4", 7, 32, 5, 12, false, true }, + {nullptr, "Forward", "mouse5", 6, 20, 5, 12, false, true }, + {nullptr, "Back", "mouse4", 7, 32, 5, 12, false, true }, // zones for LEDs - {0, "Logo", "back", 21, 50, NS, true, false }, - {0, "Wheel", "wheel", 23, 3, 8, 14, true, false }, + {nullptr, "Logo", "back", 21, 50, NS, true, false }, + {nullptr, "Wheel", "wheel", 23, 3, 8, 14, true, false }, // need to add DPI LED, even if not directly configurable for indicator to work - {0, "DPI", "dpi", 10, 10, 8, 8, true, false } + {nullptr, "DPI", "dpi", 10, 10, 8, 8, true, false } }; #define KEYCOUNT_IRONCLAW (sizeof(IronclawKeys) / sizeof(Key)) @@ -474,27 +474,27 @@ static const Key IronclawKeys[] = { // Nightsword static const Key NightswordKeys[] = { //Primary buttons - {0, "Left Mouse", "mouse1", 14, 6, 12, 26, false, true}, - {0, "Right Mouse", "mouse2", 34, 6, 12, 26, false, true}, - {0, "Wheel Up", "wheelup", 26, 5, 6, 5, false, true}, - {0, "Middle Mouse", "mouse3", 26, 10, 6, 5, false, true}, - {0, "Wheel Down", "wheeldn", 26, 15, 6, 5, false, true}, + {nullptr, "Left Mouse", "mouse1", 14, 6, 12, 26, false, true}, + {nullptr, "Right Mouse", "mouse2", 34, 6, 12, 26, false, true}, + {nullptr, "Wheel Up", "wheelup", 26, 5, 6, 5, false, true}, + {nullptr, "Middle Mouse", "mouse3", 26, 10, 6, 5, false, true}, + {nullptr, "Wheel Down", "wheeldn", 26, 15, 6, 5, false, true}, //Lighting zones - {0, "Wheel Light", "wheel", 26, 5, 8, 15, true, false}, - {0, "Front light", "front", 12, -2, 36, 8, true, false }, - {0, "Logo", "back", 24, 50, 12, 12, true, false}, - {0, "Back light", "side", 12, 64, 36, 8, true, false }, //Addition; side == bottom, under logo - {0, "DPI Light", "dpi", 6, 11, 5, 12, true, false}, // thumb side DPI indicator light + {nullptr, "Wheel Light", "wheel", 26, 5, 8, 15, true, false}, + {nullptr, "Front light", "front", 12, -2, 36, 8, true, false }, + {nullptr, "Logo", "back", 24, 50, 12, 12, true, false}, + {nullptr, "Back light", "side", 12, 64, 36, 8, true, false }, //Addition; side == bottom, under logo + {nullptr, "DPI Light", "dpi", 6, 11, 5, 12, true, false}, // thumb side DPI indicator light //DPI keys - {0, "DPI Up", "dpiup", 12, 10, 5, 7, false, true}, - {0, "DPI Down", "dpidn", 12, 18, 5, 7, false, true}, + {nullptr, "DPI Up", "dpiup", 12, 10, 5, 7, false, true}, + {nullptr, "DPI Down", "dpidn", 12, 18, 5, 7, false, true}, //Profile keys - {0, "Profile Up", "profswitch", 26, 18, 6, 10, false, true }, - {0, "Profile Down", "profdn", 26, 26, 6, 10, false, true }, + {nullptr, "Profile Up", "profswitch", 26, 18, 6, 10, false, true }, + {nullptr, "Profile Down", "profdn", 26, 26, 6, 10, false, true }, //Thumb keys (extra should be sniper) - {0, "Forward", "mouse5", 8, 21, 5, 9, false, true}, - {0, "Back", "mouse4", 8, 30, 5, 10, false, true}, - {0, "Sniper", "sniper", 0, 26, 8, 8, false, true} + {nullptr, "Forward", "mouse5", 8, 21, 5, 9, false, true}, + {nullptr, "Back", "mouse4", 8, 30, 5, 10, false, true}, + {nullptr, "Sniper", "sniper", 0, 26, 8, 8, false, true} }; #define KEYCOUNT_NIGHTSWORD (sizeof(NightswordKeys) / sizeof(Key)) @@ -505,30 +505,30 @@ static const Key NightswordKeys[] = { // Mouse map - Ironclaw RGB Wireless static const Key IronclawWirelessKeys[] = { // primary keys - {0, "Left Mouse", "mouse1", 12, 0, 12, 28, false, true }, - {0, "Right Mouse", "mouse2", 31, 0, 12, 28, false, true }, + {nullptr, "Left Mouse", "mouse1", 12, 0, 12, 28, false, true }, + {nullptr, "Right Mouse", "mouse2", 31, 0, 12, 28, false, true }, // center column keys - {0, "Wheel Up", "wheelup", 23, 3, 8, 7, false, true }, - {0, "Middle Mouse", "mouse3", 23, 7, 8, 6, false, true }, - {0, "Wheel Down", "wheeldn", 23, 12, 8, 7, false, true }, - {0, "Profile Up", "profup", 23, 18, 9, 9, false, true }, - {0, "Profile Dn", "profdn", 23, 26, 8, 9, false, true }, + {nullptr, "Wheel Up", "wheelup", 23, 3, 8, 7, false, true }, + {nullptr, "Middle Mouse", "mouse3", 23, 7, 8, 6, false, true }, + {nullptr, "Wheel Down", "wheeldn", 23, 12, 8, 7, false, true }, + {nullptr, "Profile Up", "profup", 23, 18, 9, 9, false, true }, + {nullptr, "Profile Dn", "profdn", 23, 26, 8, 9, false, true }, // left side forward/back keys - {0, "DPI Up", "dpiup", 6, 4, 6, 9, false, true }, - {0, "DPI Dn", "dpidn", 6, 10, 6, 9, false, true }, - {0, "Forward", "mouse5", 6, 20, 5, 12, false, true }, - {0, "Back", "mouse4", 7, 32, 5, 12, false, true }, - {0, "Opt", "optbtn", 9, 27, 6, 9, false, true }, + {nullptr, "DPI Up", "dpiup", 6, 4, 6, 9, false, true }, + {nullptr, "DPI Dn", "dpidn", 6, 10, 6, 9, false, true }, + {nullptr, "Forward", "mouse5", 6, 20, 5, 12, false, true }, + {nullptr, "Back", "mouse4", 7, 32, 5, 12, false, true }, + {nullptr, "Opt", "optbtn", 9, 27, 6, 9, false, true }, // zones for LEDs - {0, "Front", "front", 9, 1, 9, 9, true, false }, - {0, "Logo", "back", 21, 50, NS, true, false }, - {0, "Wheel", "wheel", 23, 3, 8, 14, true, false }, + {nullptr, "Front", "front", 9, 1, 9, 9, true, false }, + {nullptr, "Logo", "back", 21, 50, NS, true, false }, + {nullptr, "Wheel", "wheel", 23, 3, 8, 14, true, false }, // need to add DPI LED, even if not directly configurable for indicator to work - {0, "DPI", "dpi", 10, 10, 8, 8, true, false } + {nullptr, "DPI", "dpi", 10, 10, 8, 8, true, false } }; #define KEYCOUNT_IRONCLAW_W (sizeof(IronclawWirelessKeys) / sizeof(Key)) @@ -617,7 +617,7 @@ static QHash getMap(KeyMap::Model model, KeyMap::Layout layout){ // The K95 Legacy map is based on the K95 // but with the light program button map = getMap(KeyMap::K95, layout); - const Key lghtpgm = {0, "Lighting Programming", "lghtpgm", 210, 0, NS, true, true}; + const Key lghtpgm = {nullptr, "Lighting Programming", "lghtpgm", 210, 0, NS, true, true}; map.insert(lghtpgm.name, lghtpgm); break; } @@ -657,7 +657,7 @@ static QHash getMap(KeyMap::Model model, KeyMap::Layout layout){ map.remove("m3"); map.remove("mr"); // Add profile button - map["profswitch"] = {0, "Profile Switch", "profswitch", 64, 1, 11, 8, true, true}; + map["profswitch"] = {nullptr, "Profile Switch", "profswitch", 64, 1, 11, 8, true, true}; // Centre Brightness/Winlock between F1 and F4 map["light"].x = 75; map["lock"].x = 86; @@ -712,7 +712,7 @@ static QHash getMap(KeyMap::Model model, KeyMap::Layout layout){ map = getMap(KeyMap::K70, layout); // Starting from the right of F2 // Add profswitch - map["profswitch"] = {0, "Profile Switch", "profswitch", 40, 0, 10, 8, true, true}; + map["profswitch"] = {nullptr, "Profile Switch", "profswitch", 40, 0, 10, 8, true, true}; map["light"].x = 49; map["light"].width = 10; @@ -723,9 +723,9 @@ static QHash getMap(KeyMap::Model model, KeyMap::Layout layout){ map["lock"].height = 8; // Add logo1 (m3) - map["m3"] = {0, "Logo 1", "m3", 118, 0, NS, true, false}; + map["m3"] = {nullptr, "Logo 1", "m3", 118, 0, NS, true, false}; // Add logo2 (g11) - map["g11"] = {0, "Logo 2", "g11", 138, 0, NS, true, false}; + map["g11"] = {nullptr, "Logo 2", "g11", 138, 0, NS, true, false}; // Move mute and volup/dn one block to the left map["mute"].x -= 10; @@ -844,8 +844,8 @@ static QHash getMap(KeyMap::Model model, KeyMap::Layout layout){ map.remove("rwin"); // Replace volume wheel - map["voldn"] = {0, "Volume Down", "voldn", static_cast(map["mute"].x + 12), 0, map["mute"].width, map["mute"].height, true, true}; - map["volup"] = {0, "Volume Up", "volup", static_cast(map["mute"].x + 24), 0, map["mute"].width, map["mute"].height, true, true}; + map["voldn"] = {nullptr, "Volume Down", "voldn", static_cast(map["mute"].x + 12), 0, map["mute"].width, map["mute"].height, true, true}; + map["volup"] = {nullptr, "Volume Up", "volup", static_cast(map["mute"].x + 24), 0, map["mute"].width, map["mute"].height, true, true}; // Fix up the G keys map.remove("g7"); @@ -1089,7 +1089,7 @@ static QHash getMap(KeyMap::Model model, KeyMap::Layout layout){ // Same as M65 but with the wheel zone instead of the front one case KeyMap::M65E:{ map = getMap(KeyMap::M65, layout); - map["wheel"] = {0, "Wheel Light", "wheel", map["front"].x, map["front"].y, map["front"].width, map["front"].height, true, false}; + map["wheel"] = {nullptr, "Wheel Light", "wheel", map["front"].x, map["front"].y, map["front"].width, map["front"].height, true, false}; map.remove("front"); break; } @@ -1146,7 +1146,7 @@ static QHash getMap(KeyMap::Model model, KeyMap::Layout layout){ map["dpiup"]._friendlyName = "DPI Up"; map["dpiup"].height = 8; map["dpiup"].y -= 2; - map["dpidn"] = {0, "DPI Down", "dpidn", 34, 29, 6, 8, false, true}; + map["dpidn"] = {nullptr, "DPI Down", "dpidn", 34, 29, 6, 8, false, true}; break; } case KeyMap::M55:{ @@ -1171,7 +1171,7 @@ static QHash getMap(KeyMap::Model model, KeyMap::Layout layout){ KeyMap::Layout KeyMap::locale(QList>* layouts){ setlocale(LC_ALL, ""); - QString loc = setlocale(LC_CTYPE, 0); + QString loc = setlocale(LC_CTYPE, nullptr); loc = loc.toLower().replace('_', '-'); KeyMap::Layout layout = KeyMap::NO_LAYOUT; diff --git a/src/gui/keymap.h b/src/gui/keymap.h index 59e0783f..3608bc83 100644 --- a/src/gui/keymap.h +++ b/src/gui/keymap.h @@ -41,7 +41,7 @@ struct Key { } // Convert to bool -> key exists? - inline operator bool () const { return name != 0; } + inline operator bool () const { return name != nullptr; } inline bool operator !() const { return !(bool)*this; } }; @@ -165,7 +165,7 @@ public: inline uint height() const { return keyHeight; } // Keys by name - inline Key key(const QString& name) const { Key empty = {0,0,0,0,0,0,0,0,0}; return _keys.value(name, empty); } + inline Key key(const QString& name) const { Key empty = {nullptr,nullptr,nullptr,0,0,0,0,0,0}; return _keys.value(name, empty); } inline Key operator[](const QString& name) const { return key(name); } inline bool contains(const QString& name) const { return _keys.contains(name); } // List all key names/values diff --git a/src/gui/keywidget.cpp b/src/gui/keywidget.cpp index 6a896287..84cd8438 100644 --- a/src/gui/keywidget.cpp +++ b/src/gui/keywidget.cpp @@ -9,7 +9,7 @@ static const int KEY_SIZE = 12; -static QImage* m65Overlay = 0, *sabOverlay = 0, *scimOverlay = 0, *harpOverlay = 0, *glaiveOverlay = 0, *polarisOverlay = 0, *katarOverlay = 0, *m95Overlay = 0, *ironclawOverlay = 0, *nightswordOverlay = 0, *darkCoreOverlay = 0, *ironclawWirelessOverlay = 0, *glaiveproOverlay = 0,* m55Overlay = 0; +static QImage* m65Overlay= nullptr, *sabOverlay= nullptr, *scimOverlay= nullptr, *harpOverlay= nullptr, *glaiveOverlay= nullptr, *polarisOverlay= nullptr, *katarOverlay= nullptr, *m95Overlay= nullptr, *ironclawOverlay= nullptr, *nightswordOverlay= nullptr, *darkCoreOverlay= nullptr, *ironclawWirelessOverlay= nullptr, *glaiveproOverlay= nullptr,* m55Overlay= nullptr; // KbLight.cpp extern QRgb monoRgb(float r, float g, float b); @@ -108,7 +108,7 @@ void KeyWidget::paintEvent(QPaintEvent*){ if(!keyMap.isKeyboard()){ // Draw mouse overlays - const QImage* overlay = 0; + const QImage* overlay = nullptr; float xpos = 0.f, ypos = -2.f; if(model == KeyMap::M65 || model == KeyMap::M65E){ if(!m65Overlay) diff --git a/src/gui/keywidget.h b/src/gui/keywidget.h index e136f6d0..9b1f96ee 100644 --- a/src/gui/keywidget.h +++ b/src/gui/keywidget.h @@ -14,7 +14,7 @@ class KeyWidget : public QWidget Q_OBJECT public: // New key widget. rgbMode = true to display colors, false to display key names - explicit KeyWidget(QWidget *parent = 0, bool rgbMode = true); + explicit KeyWidget(QWidget *parent = nullptr, bool rgbMode = true); inline bool rgbMode() { return _rgbMode; } inline void rgbMode(bool newRgbMode) { _rgbMode = newRgbMode; update(); } // For RGB maps, monochrome = true to covert everything to grayscale diff --git a/src/gui/kperfwidget.cpp b/src/gui/kperfwidget.cpp index 91ba4aad..fa4118fe 100644 --- a/src/gui/kperfwidget.cpp +++ b/src/gui/kperfwidget.cpp @@ -14,14 +14,14 @@ KPerfWidget::KPerfWidget(QWidget *parent) : { ui->setupUi(this); // Set up indicators - indicators[0].enable = 0; indicators[0].hwEnable = ui->numBox; indicators[0].color1 = ui->numColorOn; indicators[0].color2 = ui->numColorOff; indicators[0].color3 = 0; - indicators[1].enable = 0; indicators[1].hwEnable = ui->capsBox; indicators[1].color1 = ui->capsColorOn; indicators[1].color2 = ui->capsColorOff; indicators[1].color3 = 0; - indicators[2].enable = 0; indicators[2].hwEnable = ui->scrollBox; indicators[2].color1 = ui->scrollColorOn; indicators[2].color2 = ui->scrollColorOff; indicators[2].color3 = 0; - indicators[3].enable = ui->modeBox; indicators[3].hwEnable = 0; indicators[3].color1 = ui->modeColorOn; indicators[3].color2 = ui->modeColorOff; indicators[3].color3 = 0; - indicators[4].enable = ui->macroBox; indicators[4].hwEnable = 0; indicators[4].color1 = ui->macroColorOn; indicators[4].color2 = ui->macroColorOff; indicators[4].color3 = 0; - indicators[5].enable = ui->lightBox; indicators[5].hwEnable = 0; indicators[5].color1 = ui->lightColor1; indicators[5].color2 = ui->lightColor2; indicators[5].color3 = ui->lightColor3; - indicators[6].enable = ui->lockBox; indicators[6].hwEnable = 0; indicators[6].color1 = ui->lockColorOn; indicators[6].color2 = ui->lockColorOff; indicators[6].color3 = 0; - indicators[7].enable = ui->muteBox; indicators[7].hwEnable = 0; indicators[7].color1 = ui->muteColorOn; indicators[7].color2 = ui->muteColorOff; indicators[7].color3 = ui->muteColorNA; + indicators[0].enable= nullptr; indicators[0].hwEnable = ui->numBox; indicators[0].color1 = ui->numColorOn; indicators[0].color2 = ui->numColorOff; indicators[0].color3= nullptr; + indicators[1].enable= nullptr; indicators[1].hwEnable = ui->capsBox; indicators[1].color1 = ui->capsColorOn; indicators[1].color2 = ui->capsColorOff; indicators[1].color3= nullptr; + indicators[2].enable= nullptr; indicators[2].hwEnable = ui->scrollBox; indicators[2].color1 = ui->scrollColorOn; indicators[2].color2 = ui->scrollColorOff; indicators[2].color3= nullptr; + indicators[3].enable = ui->modeBox; indicators[3].hwEnable= nullptr; indicators[3].color1 = ui->modeColorOn; indicators[3].color2 = ui->modeColorOff; indicators[3].color3= nullptr; + indicators[4].enable = ui->macroBox; indicators[4].hwEnable= nullptr; indicators[4].color1 = ui->macroColorOn; indicators[4].color2 = ui->macroColorOff; indicators[4].color3= nullptr; + indicators[5].enable = ui->lightBox; indicators[5].hwEnable= nullptr; indicators[5].color1 = ui->lightColor1; indicators[5].color2 = ui->lightColor2; indicators[5].color3 = ui->lightColor3; + indicators[6].enable = ui->lockBox; indicators[6].hwEnable= nullptr; indicators[6].color1 = ui->lockColorOn; indicators[6].color2 = ui->lockColorOff; indicators[6].color3= nullptr; + indicators[7].enable = ui->muteBox; indicators[7].hwEnable= nullptr; indicators[7].color1 = ui->muteColorOn; indicators[7].color2 = ui->muteColorOff; indicators[7].color3 = ui->muteColorNA; for(int i = 0; i < I_COUNT; i++){ indicators[i].color1->setLabel(false); indicators[i].color1->bigIcons(true); diff --git a/src/gui/kperfwidget.h b/src/gui/kperfwidget.h index 92c718c8..62abdfe8 100644 --- a/src/gui/kperfwidget.h +++ b/src/gui/kperfwidget.h @@ -17,7 +17,7 @@ class KPerfWidget : public QWidget Q_OBJECT public: - explicit KPerfWidget(QWidget *parent = 0); + explicit KPerfWidget(QWidget *parent = nullptr); ~KPerfWidget(); void setPerf(KbPerf* newPerf, KbProfile* newProfile); diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index c0da7fa2..0904d6e2 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -31,7 +31,7 @@ extern QString devpath; int MainWindow::signalHandlerFd[2] = {0, 0}; -MainWindow* MainWindow::mainWindow = 0; +MainWindow* MainWindow::mainWindow = nullptr; #if defined(Q_OS_MACOS) && !defined(OS_MAC_LEGACY) bool is_catalina_or_higher(){ diff --git a/src/gui/mainwindow.h b/src/gui/mainwindow.h index 0fed40a3..d0544de8 100644 --- a/src/gui/mainwindow.h +++ b/src/gui/mainwindow.h @@ -25,7 +25,7 @@ class MainWindow : public QMainWindow Q_OBJECT public: - explicit MainWindow(QWidget *parent = 0); + explicit MainWindow(QWidget *parent = nullptr); ~MainWindow(); static MainWindow* mainWindow; diff --git a/src/gui/modelistwidget.h b/src/gui/modelistwidget.h index 4011877b..5b09fa9d 100644 --- a/src/gui/modelistwidget.h +++ b/src/gui/modelistwidget.h @@ -11,7 +11,7 @@ class ModeListWidget : public QTableView { Q_OBJECT public: - explicit ModeListWidget(QWidget* parent = 0); + explicit ModeListWidget(QWidget* parent = nullptr); void setDevice(Kb* dev); inline void setIgnoreFocusLoss(const bool e) { ignoreFocusLoss = e; } ~ModeListWidget(); diff --git a/src/gui/mperfwidget.cpp b/src/gui/mperfwidget.cpp index 5fb852b2..c4328487 100644 --- a/src/gui/mperfwidget.cpp +++ b/src/gui/mperfwidget.cpp @@ -7,11 +7,11 @@ const static QString xyLinkPath = "UI/DPI/UnlinkXY"; MPerfWidget::MPerfWidget(QWidget *parent) : - QWidget(parent), ui(new Ui::MPerfWidget), perf(0), profile(0), _xyLink(!CkbSettings::get(xyLinkPath).toBool()), colorLink(false), isSetting(false), isDarkCore(false) { + QWidget(parent), ui(new Ui::MPerfWidget), perf(nullptr), profile(nullptr), _xyLink(!CkbSettings::get(xyLinkPath).toBool()), colorLink(false), isSetting(false), isDarkCore(false) { ui->setupUi(this); ui->xyBox->setChecked(!_xyLink); // Set up DPI stages - stages[0].indicator = ui->iButton0; stages[0].xSlider = ui->xSlider0; stages[0].ySlider = ui->ySlider0; stages[0].xBox = ui->xBox0; stages[0].yBox = ui->yBox0; stages[0].enableCheck = 0; + stages[0].indicator = ui->iButton0; stages[0].xSlider = ui->xSlider0; stages[0].ySlider = ui->ySlider0; stages[0].xBox = ui->xBox0; stages[0].yBox = ui->yBox0; stages[0].enableCheck = nullptr; stages[1].indicator = ui->iButton1; stages[1].xSlider = ui->xSlider1; stages[1].ySlider = ui->ySlider1; stages[1].xBox = ui->xBox1; stages[1].yBox = ui->yBox1; stages[1].enableCheck = ui->eBox1; stages[2].indicator = ui->iButton2; stages[2].xSlider = ui->xSlider2; stages[2].ySlider = ui->ySlider2; stages[2].xBox = ui->xBox2; stages[2].yBox = ui->yBox2; stages[2].enableCheck = ui->eBox2; stages[3].indicator = ui->iButton3; stages[3].xSlider = ui->xSlider3; stages[3].ySlider = ui->ySlider3; stages[3].xBox = ui->xBox3; stages[3].yBox = ui->yBox3; stages[3].enableCheck = ui->eBox3; diff --git a/src/gui/mperfwidget.h b/src/gui/mperfwidget.h index bae76504..eb027b94 100644 --- a/src/gui/mperfwidget.h +++ b/src/gui/mperfwidget.h @@ -20,7 +20,7 @@ class MPerfWidget : public QWidget Q_OBJECT public: - explicit MPerfWidget(QWidget *parent = 0); + explicit MPerfWidget(QWidget *parent = nullptr); ~MPerfWidget(); void setPerf(KbPerf* newPerf, KbProfile* newProfile); diff --git a/src/gui/rlistwidget.cpp b/src/gui/rlistwidget.cpp index 099cec95..5c225deb 100644 --- a/src/gui/rlistwidget.cpp +++ b/src/gui/rlistwidget.cpp @@ -17,7 +17,7 @@ RListWidget::RListWidget(QWidget *parent) : void RListWidget::timerTick(){ bool reordered = false; - QListWidgetItem* reselect = 0; + QListWidgetItem* reselect = nullptr; QList newItems; // Scan the item list to see if they changed int c = count(); diff --git a/src/gui/rlistwidget.h b/src/gui/rlistwidget.h index 2cf07c5a..fd11491d 100644 --- a/src/gui/rlistwidget.h +++ b/src/gui/rlistwidget.h @@ -10,7 +10,7 @@ class RListWidget : public QListWidget { Q_OBJECT public: - explicit RListWidget(QWidget *parent = 0); + explicit RListWidget(QWidget *parent = nullptr); signals: void orderChanged(); diff --git a/src/gui/settingswidget.h b/src/gui/settingswidget.h index 7e3fff1c..45c86390 100644 --- a/src/gui/settingswidget.h +++ b/src/gui/settingswidget.h @@ -16,7 +16,7 @@ class SettingsWidget : public QWidget Q_OBJECT public: - explicit SettingsWidget(QWidget *parent = 0); + explicit SettingsWidget(QWidget *parent = nullptr); ~SettingsWidget(); // Set text labels diff --git a/src/gui/xcb/xwindowdetector.h b/src/gui/xcb/xwindowdetector.h index 938f1b94..a6ee88eb 100644 --- a/src/gui/xcb/xwindowdetector.h +++ b/src/gui/xcb/xwindowdetector.h @@ -14,7 +14,7 @@ class XWindowDetector : public QThread Q_OBJECT #ifdef USE_XCB_EWMH public: - explicit XWindowDetector(QObject *parent = 0); + explicit XWindowDetector(QObject* parent = nullptr); void terminateEventLoop(); signals: