ckb-next
v0.2.8 at branch master
ckb-next driver for corsair devices
|
#include <src/ckb/kbbind.h>
Public Slots | |
void | keyEvent (const QString &key, bool down) |
Signals | |
void | didLoad () |
void | layoutChanged () |
void | updated () |
Public Member Functions | |
KbBind (KbMode *modeParent, Kb *devParent, const KeyMap &keyMap) | |
KbBind (KbMode *modeParent, Kb *devParent, const KeyMap &keyMap, const KbBind &other) | |
KbBind. More... | |
void | load (CkbSettings &settings) |
void | save (CkbSettings &settings) |
bool | needsSave () const |
const KeyMap & | map () |
void | map (const KeyMap &map) |
bool | isISO () const |
bool | isKeyboard () const |
bool | isMouse () const |
KbPerf * | perf () |
KbLight * | light () |
QString | action (const QString &key) |
QString | defaultAction (const QString &key) |
QString | friendlyName (const QString &key) |
QString | friendlyActionName (const QString &key) |
void | setAction (const QString &key, const QString &action) |
void | setAction (const QStringList &keys, const QString &action) |
void | resetAction (const QString &key) |
void | resetAction (const QStringList &keys) |
void | noAction (const QString &key) |
void | noAction (const QStringList &keys) |
bool | winLock () |
void | winLock (bool newWinLock) |
void | update (QFile &cmd, bool force=false) |
void | setNeedsUpdate () |
int | getMacroNumber () |
KbBind::getMacroNumber. More... | |
QString | getMacroPath () |
KbBind::getMacroPath. More... | |
void | handleNotificationChannel (bool start) |
handleNotificationChannel sends commands to ckb-daemon for (de-) activating the notify channel. Send a notify cmd to the keyboard to set or clear notification for reading macro definition. The file handle for the cmd pipe is stored in lastCmd. More... | |
Static Public Member Functions | |
static QString | globalRemap (const QString &key) |
static void | setGlobalRemap (const QHash< QString, QString > keyToActual) |
static void | loadGlobalRemap () |
static void | saveGlobalRemap () |
static QString | defaultAction (const QString &key, KeyMap::Model model) |
Private Member Functions | |
Kb * | devParent () const |
KbMode * | modeParent () const |
KeyAction * | bindAction (const QString &key) |
Private Attributes | |
Kb * | _devParent |
quint64 | lastGlobalRemapTime |
QFile * | lastCmd |
lastCmd is a cache-hack. Because the QFile ist opened in Kb, and we need it in the macro processing functions, we cache the value her in lastCmd. More... | |
KeyMap | _map |
QHash< QString, KeyAction * > | _bind |
bool | _winLock |
bool | _needsUpdate |
bool | _needsSave |
Static Private Attributes | |
static QHash< QString, QString > | _globalRemap |
static quint64 | globalRemapTime = 0 |
Friends | |
class | KeyAction |
Definition at line 12 of file kbbind.cpp.
KbBind::KbBind | ( | KbMode * | modeParent, |
Kb * | parentBoard, | ||
const KeyMap & | keyMap, | ||
const KbBind & | other | ||
) |
KbBind::KbBind // copy all existing Key bindings.
modeParent | |
devParent | |
keyMap | |
other | This is the KbBind object to copy from Use this constructor to copy an existing Binding |
modeParent | |
parentBoard | |
keyMap | |
other |
Create a new Hash table and copy all entries
clear the destination list (there are the original KeyActions as references, so do not delete them)
and move the KeyActions we just created
Definition at line 24 of file kbbind.cpp.
References _bind, KeyAction, map(), and KeyAction::value().
QString KbBind::action | ( | const QString & | key | ) |
Definition at line 145 of file kbbind.cpp.
References bindAction(), globalRemap(), and KeyAction::value().
Referenced by friendlyActionName(), KbBindWidget::on_copyButton_clicked(), resetAction(), RebindWidget::setSelection(), and KbBindWidget::updateBind().
|
private |
Definition at line 140 of file kbbind.cpp.
References _bind, KeyAction::defaultAction(), devParent(), and KeyAction.
Referenced by action(), keyEvent(), and update().
QString KbBind::defaultAction | ( | const QString & | key | ) |
Definition at line 155 of file kbbind.cpp.
References devParent().
Referenced by KeyWidget::paintEvent(), and RebindWidget::setBind().
|
static |
Definition at line 150 of file kbbind.cpp.
References KeyAction::defaultAction(), and globalRemap().
|
inlineprivate |
Definition at line 115 of file kbbind.h.
References _devParent.
Referenced by bindAction(), defaultAction(), getMacroNumber(), getMacroPath(), KeyAction::keyEvent(), and save().
|
signal |
Definition at line 155 of file moc_kbbind.cpp.
Referenced by load().
QString KbBind::friendlyActionName | ( | const QString & | key | ) |
Definition at line 166 of file kbbind.cpp.
References _map, action(), and KeyAction.
Referenced by KbBindWidget::updateSelDisplay().
QString KbBind::friendlyName | ( | const QString & | key | ) |
Definition at line 159 of file kbbind.cpp.
References _map, Key::friendlyName(), and globalRemap().
int KbBind::getMacroNumber | ( | ) |
Definition at line 266 of file kbbind.cpp.
References devParent(), and Kb::getMacroNumber().
Referenced by handleNotificationChannel(), and RebindWidget::on_btnStartMacro_clicked().
QString KbBind::getMacroPath | ( | ) |
Definition at line 274 of file kbbind.cpp.
References devParent(), and Kb::getMacroPath().
Referenced by RebindWidget::on_btnStartMacro_clicked().
|
static |
Definition at line 98 of file kbbind.cpp.
References _globalRemap.
Referenced by action(), defaultAction(), friendlyName(), keyEvent(), noAction(), KeyWidget::paintEvent(), resetAction(), setAction(), and SettingsWidget::SettingsWidget().
void KbBind::handleNotificationChannel | ( | bool | start | ) |
start | is boolean. If true, notification channel is opened for all keys, otherwise channel ist closed. |
start | If true, notification channel is opened for all keys, otherwise channel ist closed. |
Definition at line 284 of file kbbind.cpp.
References getMacroNumber(), and lastCmd.
Referenced by RebindWidget::on_btnStartMacro_clicked(), and RebindWidget::on_btnStopMacro_clicked().
|
inline |
Definition at line 43 of file kbbind.h.
References _map, and KeyMap::isISO().
|
inline |
Definition at line 44 of file kbbind.h.
References _map, and KeyMap::isKeyboard().
|
inline |
Definition at line 45 of file kbbind.h.
References _map, and KeyMap::isMouse().
Referenced by KbBindWidget::on_copyButton_clicked(), KbBindWidget::on_resetButton_clicked(), RebindWidget::setBind(), and KbBindWidget::updateSelDisplay().
|
slot |
Definition at line 296 of file kbbind.cpp.
References bindAction(), globalRemap(), and KeyAction::keyEvent().
Referenced by Kb::readNotify().
|
signal |
Definition at line 161 of file moc_kbbind.cpp.
Referenced by map().
KbLight * KbBind::light | ( | ) |
Definition at line 54 of file kbbind.cpp.
References KbMode::light(), and modeParent().
Referenced by RebindWidget::applyChanges(), KeyAction::keyEvent(), and RebindWidget::setSelection().
void KbBind::load | ( | CkbSettings & | settings | ) |
Definition at line 58 of file kbbind.cpp.
References _bind, _map, _needsSave, _winLock, CkbSettings::childKeys(), didLoad(), KeyMap::fromName(), KeyMap::fromStorage(), KeyAction, map(), and CkbSettings::value().
Referenced by KbMode::KbMode().
|
static |
Definition at line 116 of file kbbind.cpp.
References _globalRemap, CkbSettings::childKeys(), globalRemapTime, and CkbSettings::value().
Referenced by SettingsWidget::SettingsWidget().
|
inline |
Definition at line 41 of file kbbind.h.
References _map.
Referenced by KbBind(), KbMode::keyMap(), load(), map(), KbBindWidget::newLayout(), KbBindWidget::on_copyButton_clicked(), KbBindWidget::on_resetButton_clicked(), RebindWidget::setBind(), KbBindWidget::updateBind(), and KbBindWidget::updateSelDisplay().
void KbBind::map | ( | const KeyMap & | map | ) |
Definition at line 133 of file kbbind.cpp.
References _map, _needsSave, _needsUpdate, layoutChanged(), and map().
|
inlineprivate |
|
inline |
Definition at line 38 of file kbbind.h.
References _needsSave.
Referenced by KbMode::needsSave().
void KbBind::noAction | ( | const QString & | key | ) |
Definition at line 181 of file kbbind.cpp.
References _bind, _map, globalRemap(), KeyMap::key(), KeyAction, and resetAction().
Referenced by RebindWidget::applyChanges(), and RebindWidget::on_unbindButton_clicked().
|
inline |
Definition at line 76 of file kbbind.h.
References noAction().
Referenced by noAction().
KbPerf * KbBind::perf | ( | ) |
Definition at line 50 of file kbbind.cpp.
References modeParent(), and KbMode::perf().
Referenced by KeyAction::keyEvent(), and RebindWidget::setBind().
void KbBind::resetAction | ( | const QString & | key | ) |
Definition at line 171 of file kbbind.cpp.
References _bind, _needsSave, _needsUpdate, action(), and globalRemap().
Referenced by noAction(), KbBindWidget::on_resetButton_clicked(), RebindWidget::on_resetButton_clicked(), and setAction().
|
inline |
Definition at line 73 of file kbbind.h.
References resetAction().
Referenced by resetAction().
void KbBind::save | ( | CkbSettings & | settings | ) |
Definition at line 81 of file kbbind.cpp.
References _bind, _map, _needsSave, _winLock, KeyAction::defaultAction(), devParent(), KeyMap::name(), CkbSettings::setValue(), and KeyAction::value().
Referenced by KbMode::save().
|
static |
Definition at line 124 of file kbbind.cpp.
References _globalRemap, and CkbSettings::setValue().
Referenced by SettingsWidget::updateModifiers().
void KbBind::setAction | ( | const QString & | key, |
const QString & | action | ||
) |
Definition at line 189 of file kbbind.cpp.
References _bind, _map, globalRemap(), KeyMap::key(), KeyAction, and resetAction().
Referenced by RebindWidget::applyChanges(), and KbBindWidget::on_copyButton_clicked().
|
inline |
Definition at line 70 of file kbbind.h.
References setAction().
Referenced by setAction().
|
static |
Definition at line 104 of file kbbind.cpp.
References _globalRemap, and globalRemapTime.
Referenced by SettingsWidget::updateModifiers().
|
inline |
Definition at line 85 of file kbbind.h.
References _needsUpdate.
Referenced by KbMode::setNeedsUpdate().
void KbBind::update | ( | QFile & | cmd, |
bool | force = false |
||
) |
Definition at line 197 of file kbbind.cpp.
References _bind, _globalRemap, _needsUpdate, _winLock, bindAction(), KeyAction::driverName(), globalRemapTime, KeyAction::isValidMacro(), lastCmd, lastGlobalRemapTime, KeyAction::macroContent(), updated(), and KeyAction::value().
Referenced by Kb::frameUpdate().
|
signal |
Definition at line 167 of file moc_kbbind.cpp.
Referenced by update().
|
inline |
Definition at line 79 of file kbbind.h.
References _winLock.
Referenced by KeyAction::keyEvent().
|
inline |
|
friend |
Definition at line 137 of file kbbind.h.
Referenced by bindAction(), friendlyActionName(), KbBind(), load(), noAction(), and setAction().
|
private |
Definition at line 132 of file kbbind.h.
Referenced by bindAction(), KbBind(), load(), noAction(), resetAction(), save(), setAction(), and update().
|
private |
Definition at line 114 of file kbbind.h.
Referenced by devParent().
|
staticprivate |
Definition at line 120 of file kbbind.h.
Referenced by globalRemap(), loadGlobalRemap(), saveGlobalRemap(), setGlobalRemap(), and update().
|
private |
Definition at line 130 of file kbbind.h.
Referenced by friendlyActionName(), friendlyName(), isISO(), isKeyboard(), isMouse(), load(), map(), noAction(), save(), and setAction().
|
private |
Definition at line 136 of file kbbind.h.
Referenced by load(), map(), needsSave(), resetAction(), and save().
|
private |
Definition at line 135 of file kbbind.h.
Referenced by map(), resetAction(), setNeedsUpdate(), update(), and winLock().
|
private |
|
staticprivate |
Definition at line 121 of file kbbind.h.
Referenced by loadGlobalRemap(), setGlobalRemap(), and update().
|
private |
Definition at line 128 of file kbbind.h.
Referenced by handleNotificationChannel(), and update().
|
private |