ckb-next
v0.2.8 at branch master
ckb-next driver for corsair devices
|
#include <src/ckb/rebindwidget.h>
Public Member Functions | |
RebindWidget (QWidget *parent) | |
~RebindWidget () | |
void | setBind (KbBind *newBind, KbProfile *newProfile) |
void | setSelection (const QStringList &newSelection, bool applyPrevious=false) |
Private Member Functions | |
void | setBox (QWidget *box) |
void | convertMacroBox () |
RebindWidget::convertMacroBox converts the macroBox content. The KB sends each keypress as "key [+|-]<keyname><newline>" This is followed by timing information (delays between keystrokes). More... | |
void | helpStatus (int status) |
RebindWidget::helpStatus shows a help line in the ui. More... | |
void | setCorrectRadioButton (QString macdef) |
RebindWidget::setCorrectRadioButton. More... | |
Private Attributes | |
Ui::RebindWidget * | ui |
KbBind * | bind |
KbProfile * | profile |
QStringList | selection |
QStringList | typingKeys |
QStringList | modKeys |
QStringList | fnKeys |
QStringList | numKeys |
QStringList | mediaKeys |
QStringList | mouseKeys |
QStringList | mouseExtKeys |
QStringList | wheelKeys |
MacroReader * | macReader |
macReader holds the MacroReader when macro recording starts. More... | |
Static Private Attributes | |
static const int | TAB_KB = 0 |
static const int | TAB_MOUSE = 1 |
static const int | TAB_ANIM = 2 |
static const int | TAB_SPECIAL = 3 |
static const int | TAB_PROGRAM = 4 |
static const int | TAB_MACRO = 5 |
Definition at line 15 of file rebindwidget.h.
|
explicit |
Definition at line 9 of file rebindwidget.cpp.
References Ui_RebindWidget::fnBox, fnKeys, KeyMap::friendlyName(), Ui_RebindWidget::lightWrapBox, Ui_RebindWidget::mediaBox, mediaKeys, Ui_RebindWidget::modBox, Ui_RebindWidget::modeWrapBox, modKeys, mouseExtKeys, mouseKeys, Ui_RebindWidget::numBox, numKeys, Ui_RebindWidget::programKpExtra, Ui_RebindWidget::programKrExtra, Ui_RebindWidget::progTipLabel, Ui_RebindWidget::setupUi(), ui, and wheelKeys.
RebindWidget::~RebindWidget | ( | ) |
Definition at line 59 of file rebindwidget.cpp.
References ui.
|
privateslot |
G-key macro handling: Set the macro definiton for all keys selected (indeed, it may be multiple keys). First, concat the Macro Key Definion and the Macro plain text after escaping possible colos in the parts for Macro Text and Macro Comment.
But first, there is a special condition to handle: You have recorded a macro with timing infos. Afterwards you changed manually the timing infos in the pteMacroBox and press Apply. In that case we must overwrite the txtBuffer to remember your changes.
Definition at line 334 of file rebindwidget.cpp.
References anim, KeyAction::animAction(), Ui_RebindWidget::animBox, Ui_RebindWidget::animKrBox, KbLight::animList(), Ui_RebindWidget::animOnceBox, bind, DPI_OFFSET, KeyAction::dpiAction(), Ui_RebindWidget::dpiBox, Ui_RebindWidget::dpiCustXBox, Ui_RebindWidget::dpiCustYBox, Ui_RebindWidget::fnBox, fnKeys, KbAnim::guid(), KbBind::light(), KeyAction::lightAction(), Ui_RebindWidget::lightBox, Ui_RebindWidget::lightWrapBox, KeyAction::lockAction(), Ui_RebindWidget::lockBox, KeyAction::macroAction(), Ui_RebindWidget::mb2Box, Ui_RebindWidget::mbBox, Ui_RebindWidget::mediaBox, mediaKeys, Ui_RebindWidget::modBox, KeyAction::modeAction(), Ui_RebindWidget::modeBox, Ui_RebindWidget::modeWrapBox, modKeys, mouseExtKeys, mouseKeys, KbBind::noAction(), Ui_RebindWidget::numBox, numKeys, KeyAction::PROGRAM_PR_MULTI, KeyAction::PROGRAM_RE_INDEF, KeyAction::PROGRAM_RE_KPSTOP, KeyAction::PROGRAM_RE_MULTI, KeyAction::programAction(), Ui_RebindWidget::programKpBox, Ui_RebindWidget::programKpModeBox, Ui_RebindWidget::programKpSIBox, Ui_RebindWidget::programKrBox, Ui_RebindWidget::programKrModeBox, Ui_RebindWidget::programKrSIBox, Ui_RebindWidget::pteMacroBox, Ui_RebindWidget::pteMacroComment, Ui_RebindWidget::pteMacroText, Ui_RebindWidget::rb_delay_asTyped, KbBind::setAction(), Ui_RebindWidget::txtBuffer, Ui_RebindWidget::typingBox, typingKeys, ui, Ui_RebindWidget::wheelBox, and wheelKeys.
Referenced by on_applyButton_clicked(), and setSelection().
|
private |
The ckb-daemon needs a shorter format, only " [+|-]<keyname>=<delay>", multiple entries are separated by comma.
That function does the conversion.
Definition at line 808 of file rebindwidget.cpp.
References Ui_RebindWidget::pteMacroBox, Ui_RebindWidget::rb_delay_default, Ui_RebindWidget::rb_delay_no, Ui_RebindWidget::txtBuffer, and ui.
Referenced by on_btnStopMacro_clicked(), on_rb_delay_asTyped_toggled(), on_rb_delay_default_toggled(), and on_rb_delay_no_toggled().
|
private |
status | determines what to display. |
Definition at line 782 of file rebindwidget.cpp.
References Ui_RebindWidget::lbl_macro, and ui.
Referenced by on_btnClearMacro_clicked(), on_btnStartMacro_clicked(), on_btnStopMacro_clicked(), and setBox().
|
privateslot |
Definition at line 613 of file rebindwidget.cpp.
References Ui_RebindWidget::animBox, Ui_RebindWidget::animButton, setBox(), and ui.
|
privateslot |
|
privateslot |
Definition at line 406 of file rebindwidget.cpp.
References applyChanges(), on_btnStopMacro_clicked(), and selection.
|
privateslot |
Definition at line 774 of file rebindwidget.cpp.
References helpStatus().
|
privateslot |
The UI is protected against false clicking (e.g. if you type start and than Apply, the channel is closed in wrong order).
At this time, all neccessary params like macroNumber, macroPath, cmdFile etc. had been cached.
Definition at line 724 of file rebindwidget.cpp.
References Ui_RebindWidget::applyButton, bind, Ui_RebindWidget::btnStartMacro, Ui_RebindWidget::btnStopMacro, KbBind::getMacroNumber(), KbBind::getMacroPath(), KbBind::handleNotificationChannel(), helpStatus(), macReader, Ui_RebindWidget::pteMacroBox, Ui_RebindWidget::pteMacroText, Ui_RebindWidget::rb_delay_asTyped, Ui_RebindWidget::rb_delay_default, Ui_RebindWidget::rb_delay_no, Ui_RebindWidget::resetButton, ui, and Ui_RebindWidget::unbindButton.
|
privateslot |
Afterwards, the characters in the MacroBox are changed from KB-out format to cmd-in format. At last the UI changes to the new state.
Definition at line 749 of file rebindwidget.cpp.
References Ui_RebindWidget::applyButton, bind, Ui_RebindWidget::btnStartMacro, Ui_RebindWidget::btnStopMacro, convertMacroBox(), KbBind::handleNotificationChannel(), helpStatus(), macReader, Ui_RebindWidget::rb_delay_asTyped, Ui_RebindWidget::rb_delay_default, Ui_RebindWidget::rb_delay_no, Ui_RebindWidget::resetButton, ui, and Ui_RebindWidget::unbindButton.
Referenced by on_applyButton_clicked().
|
privateslot |
Definition at line 415 of file rebindwidget.cpp.
References selection, and setSelection().
|
privateslot |
Definition at line 539 of file rebindwidget.cpp.
References DPI_CUST_IDX, Ui_RebindWidget::dpiBox, Ui_RebindWidget::dpiButton, Ui_RebindWidget::dpiCustLabel, Ui_RebindWidget::dpiCustXBox, Ui_RebindWidget::dpiCustYBox, setBox(), and ui.
|
privateslot |
|
privateslot |
Definition at line 485 of file rebindwidget.cpp.
References Ui_RebindWidget::fnBox, Ui_RebindWidget::fnButton, setBox(), and ui.
|
privateslot |
|
privateslot |
Definition at line 571 of file rebindwidget.cpp.
References Ui_RebindWidget::lightBox, Ui_RebindWidget::lightButton, Ui_RebindWidget::lightWrapBox, setBox(), and ui.
|
privateslot |
|
privateslot |
Definition at line 582 of file rebindwidget.cpp.
References Ui_RebindWidget::lockBox, Ui_RebindWidget::lockButton, setBox(), and ui.
|
privateslot |
|
privateslot |
Definition at line 521 of file rebindwidget.cpp.
References Ui_RebindWidget::mb2Box, Ui_RebindWidget::mb2Button, setBox(), and ui.
|
privateslot |
|
privateslot |
Definition at line 512 of file rebindwidget.cpp.
References Ui_RebindWidget::mbBox, Ui_RebindWidget::mbButton, setBox(), and ui.
|
privateslot |
|
privateslot |
Definition at line 503 of file rebindwidget.cpp.
References Ui_RebindWidget::mediaBox, Ui_RebindWidget::mediaButton, setBox(), and ui.
|
privateslot |
|
privateslot |
Definition at line 476 of file rebindwidget.cpp.
References Ui_RebindWidget::modBox, Ui_RebindWidget::modButton, setBox(), and ui.
|
privateslot |
|
privateslot |
Definition at line 558 of file rebindwidget.cpp.
References Ui_RebindWidget::modeBox, Ui_RebindWidget::modeButton, Ui_RebindWidget::modeWrapBox, setBox(), and ui.
|
privateslot |
|
privateslot |
Definition at line 494 of file rebindwidget.cpp.
References Ui_RebindWidget::numBox, Ui_RebindWidget::numButton, setBox(), and ui.
|
privateslot |
|
privateslot |
Definition at line 591 of file rebindwidget.cpp.
References Ui_RebindWidget::programKpBox, Ui_RebindWidget::programKpButton, Ui_RebindWidget::programKpExtra, setBox(), and ui.
|
privateslot |
Definition at line 662 of file rebindwidget.cpp.
References Ui_RebindWidget::programKpBox, setBox(), and ui.
|
privateslot |
Definition at line 700 of file rebindwidget.cpp.
References Ui_RebindWidget::programKpModeBox, and ui.
|
privateslot |
Definition at line 602 of file rebindwidget.cpp.
References Ui_RebindWidget::programKrBox, Ui_RebindWidget::programKrButton, Ui_RebindWidget::programKrExtra, setBox(), and ui.
|
privateslot |
Definition at line 671 of file rebindwidget.cpp.
References Ui_RebindWidget::programKrBox, setBox(), and ui.
|
privateslot |
Definition at line 705 of file rebindwidget.cpp.
References Ui_RebindWidget::programKrModeBox, and ui.
|
privateslot |
Definition at line 470 of file rebindwidget.cpp.
References Ui_RebindWidget::pteMacroBox, setBox(), and ui.
|
privateslot |
checked | This button ist clicked to use the delay times, as they are recorded. Returs a warning message, if we are not in the recording phase, because then we don't have the delay times any more. |
Definition at line 862 of file rebindwidget.cpp.
References convertMacroBox().
|
privateslot |
checked | This is as easy as the no-delay-button, because this means take the default values. |
Definition at line 873 of file rebindwidget.cpp.
References convertMacroBox().
|
privateslot |
checked | The following slots are triggerd by changing the mutual exclusive radio buttons when choosing the delay. They are called, if the button ist enabled. This first one should disable all delay. |
Definition at line 850 of file rebindwidget.cpp.
References convertMacroBox().
|
privateslot |
Definition at line 420 of file rebindwidget.cpp.
References bind, KbBind::resetAction(), and selection.
|
privateslot |
Definition at line 461 of file rebindwidget.cpp.
References setBox(), Ui_RebindWidget::typingBox, Ui_RebindWidget::typingButton, and ui.
|
privateslot |
|
privateslot |
Definition at line 424 of file rebindwidget.cpp.
References bind, KbBind::noAction(), and selection.
|
privateslot |
Definition at line 530 of file rebindwidget.cpp.
References setBox(), ui, Ui_RebindWidget::wheelBox, and Ui_RebindWidget::wheelButton.
|
privateslot |
Definition at line 63 of file rebindwidget.cpp.
References bind, KeyMap::byPosition(), KbBind::defaultAction(), KbPerf::dpi(), KbPerf::DPI_COUNT, DPI_OFFSET, Ui_RebindWidget::dpiBox, Ui_RebindWidget::dpiButton, Ui_RebindWidget::dpiCustLabel, Ui_RebindWidget::dpiCustXBox, Ui_RebindWidget::dpiCustYBox, Ui_RebindWidget::dpiWarning, fnKeys, Key::friendlyName(), KeyMap::isISO(), KbBind::isMouse(), KeyMap::K95, KeyMap::layout(), KbBind::map(), mediaKeys, Ui_RebindWidget::modeBox, KbProfile::modes(), modKeys, KbMode::name(), numKeys, KbBind::perf(), profile, setSelection(), Ui_RebindWidget::typingBox, typingKeys, and ui.
Referenced by KbBindWidget::newLayout(), and KbBindWidget::setBind().
|
private |
Definition at line 428 of file rebindwidget.cpp.
References Ui_RebindWidget::animBox, Ui_RebindWidget::dpiBox, Ui_RebindWidget::fnBox, helpStatus(), Ui_RebindWidget::lightBox, Ui_RebindWidget::lockBox, Ui_RebindWidget::mb2Box, Ui_RebindWidget::mbBox, Ui_RebindWidget::mediaBox, Ui_RebindWidget::modBox, Ui_RebindWidget::modeBox, Ui_RebindWidget::numBox, Ui_RebindWidget::programKpBox, Ui_RebindWidget::programKpButton, Ui_RebindWidget::programKrBox, Ui_RebindWidget::programKrButton, Ui_RebindWidget::pteMacroBox, Ui_RebindWidget::txtBuffer, Ui_RebindWidget::typingBox, ui, and Ui_RebindWidget::wheelBox.
Referenced by on_animBox_currentIndexChanged(), on_dpiBox_currentIndexChanged(), on_fnBox_currentIndexChanged(), on_lightBox_currentIndexChanged(), on_lockBox_currentIndexChanged(), on_mb2Box_currentIndexChanged(), on_mbBox_currentIndexChanged(), on_mediaBox_currentIndexChanged(), on_modBox_currentIndexChanged(), on_modeBox_currentIndexChanged(), on_numBox_currentIndexChanged(), on_programKpBox_textChanged(), on_programKpButton_clicked(), on_programKrBox_textChanged(), on_programKrButton_clicked(), on_pteMacroBox_textChanged(), on_typingBox_currentIndexChanged(), on_wheelBox_currentIndexChanged(), and setSelection().
|
private |
macdef | Set the radiobutton for timing paramters according to the context. If no "=" followed by a number and comma can be found, it is the default button. If "=" can be found and numbers with more than one digit (means: > 9), it is the "asTyped" button Otherwise it is the "no" button. |
Definition at line 887 of file rebindwidget.cpp.
References Ui_RebindWidget::rb_delay_asTyped, Ui_RebindWidget::rb_delay_default, Ui_RebindWidget::rb_delay_no, and ui.
Referenced by setSelection().
void RebindWidget::setSelection | ( | const QStringList & | newSelection, |
bool | applyPrevious = false |
||
) |
Definition at line 128 of file rebindwidget.cpp.
References KbBind::action(), anim, Ui_RebindWidget::animBox, KeyAction::animInfo(), Ui_RebindWidget::animKrBox, KbLight::animList(), Ui_RebindWidget::animOnceBox, applyChanges(), bind, KeyAction::DPI_CUSTOM, DPI_OFFSET, Ui_RebindWidget::dpiBox, Ui_RebindWidget::dpiCustXBox, Ui_RebindWidget::dpiCustYBox, KeyAction::dpiInfo(), KbLight::findAnimIdx(), Ui_RebindWidget::fnBox, fnKeys, KeyAction::isAnim(), KeyAction::isDPI(), KeyAction::isMouse(), KeyAction::isNormal(), KeyAction::isProgram(), KeyAction::isSpecial(), KeyAction::isValidMacro(), KbBind::light(), KeyAction::LIGHT_DOWN, KeyAction::LIGHT_DOWN_WRAP, KeyAction::LIGHT_UP, KeyAction::LIGHT_UP_WRAP, Ui_RebindWidget::lightBox, Ui_RebindWidget::lightWrapBox, Ui_RebindWidget::lockBox, KeyAction::macroContent(), KeyAction::macroDisplay(), KeyAction::macroLine(), KeyAction::macroTiming(), Ui_RebindWidget::mb2Box, Ui_RebindWidget::mbBox, Ui_RebindWidget::mediaBox, mediaKeys, Ui_RebindWidget::modBox, KeyAction::MODE_NEXT, KeyAction::MODE_NEXT_WRAP, KeyAction::MODE_PREV, KeyAction::MODE_PREV_WRAP, Ui_RebindWidget::modeBox, Ui_RebindWidget::modeWrapBox, modKeys, mouseExtKeys, mouseKeys, KbAnim::name(), Ui_RebindWidget::numBox, numKeys, KeyAction::PROGRAM_PR_MULTI, KeyAction::PROGRAM_RE_INDEF, KeyAction::PROGRAM_RE_KPSTOP, KeyAction::PROGRAM_RE_MULTI, KeyAction::programInfo(), Ui_RebindWidget::programKpBox, Ui_RebindWidget::programKpModeBox, Ui_RebindWidget::programKpSIBox, Ui_RebindWidget::programKrBox, Ui_RebindWidget::programKrModeBox, Ui_RebindWidget::programKrSIBox, Ui_RebindWidget::pteMacroBox, Ui_RebindWidget::pteMacroComment, Ui_RebindWidget::pteMacroText, selection, setBox(), setCorrectRadioButton(), KeyAction::specialInfo(), TAB_ANIM, TAB_KB, TAB_MACRO, TAB_MOUSE, TAB_PROGRAM, TAB_SPECIAL, Ui_RebindWidget::tabWidget, Ui_RebindWidget::txtBuffer, Ui_RebindWidget::typingBox, typingKeys, ui, Ui_RebindWidget::wheelBox, and wheelKeys.
Referenced by KbBindWidget::newSelection(), on_cancelButton_clicked(), setBind(), and KbBindWidget::updateBind().
|
private |
Definition at line 94 of file rebindwidget.h.
Referenced by applyChanges(), on_btnStartMacro_clicked(), on_btnStopMacro_clicked(), on_resetButton_clicked(), on_unbindButton_clicked(), setBind(), and setSelection().
|
private |
Definition at line 100 of file rebindwidget.h.
Referenced by applyChanges(), RebindWidget(), setBind(), and setSelection().
|
private |
Definition at line 106 of file rebindwidget.h.
Referenced by on_btnStartMacro_clicked(), and on_btnStopMacro_clicked().
|
private |
Definition at line 102 of file rebindwidget.h.
Referenced by applyChanges(), RebindWidget(), setBind(), and setSelection().
|
private |
Definition at line 99 of file rebindwidget.h.
Referenced by applyChanges(), RebindWidget(), setBind(), and setSelection().
|
private |
Definition at line 104 of file rebindwidget.h.
Referenced by applyChanges(), RebindWidget(), and setSelection().
|
private |
Definition at line 103 of file rebindwidget.h.
Referenced by applyChanges(), RebindWidget(), and setSelection().
|
private |
Definition at line 101 of file rebindwidget.h.
Referenced by applyChanges(), RebindWidget(), setBind(), and setSelection().
|
private |
Definition at line 95 of file rebindwidget.h.
Referenced by setBind().
|
private |
Definition at line 96 of file rebindwidget.h.
Referenced by on_applyButton_clicked(), on_cancelButton_clicked(), on_resetButton_clicked(), on_unbindButton_clicked(), and setSelection().
|
staticprivate |
Definition at line 83 of file rebindwidget.h.
Referenced by setSelection().
|
staticprivate |
Definition at line 83 of file rebindwidget.h.
Referenced by setSelection().
|
staticprivate |
Definition at line 83 of file rebindwidget.h.
Referenced by setSelection().
|
staticprivate |
Definition at line 83 of file rebindwidget.h.
Referenced by setSelection().
|
staticprivate |
Definition at line 83 of file rebindwidget.h.
Referenced by setSelection().
|
staticprivate |
Definition at line 83 of file rebindwidget.h.
Referenced by setSelection().
|
private |
Definition at line 98 of file rebindwidget.h.
Referenced by applyChanges(), setBind(), and setSelection().
|
private |
Definition at line 80 of file rebindwidget.h.
Referenced by applyChanges(), convertMacroBox(), helpStatus(), on_animBox_currentIndexChanged(), on_animButton_clicked(), on_btnStartMacro_clicked(), on_btnStopMacro_clicked(), on_dpiBox_currentIndexChanged(), on_dpiButton_clicked(), on_fnBox_currentIndexChanged(), on_fnButton_clicked(), on_lightBox_currentIndexChanged(), on_lightButton_clicked(), on_lockBox_currentIndexChanged(), on_lockButton_clicked(), on_mb2Box_currentIndexChanged(), on_mb2Button_clicked(), on_mbBox_currentIndexChanged(), on_mbButton_clicked(), on_mediaBox_currentIndexChanged(), on_mediaButton_clicked(), on_modBox_currentIndexChanged(), on_modButton_clicked(), on_modeBox_currentIndexChanged(), on_modeButton_clicked(), on_numBox_currentIndexChanged(), on_numButton_clicked(), on_programKpBox_textChanged(), on_programKpButton_clicked(), on_programKpSIBox_clicked(), on_programKrBox_textChanged(), on_programKrButton_clicked(), on_programKrSIBox_clicked(), on_pteMacroBox_textChanged(), on_typingBox_currentIndexChanged(), on_typingButton_clicked(), on_wheelBox_currentIndexChanged(), on_wheelButton_clicked(), RebindWidget(), setBind(), setBox(), setCorrectRadioButton(), setSelection(), and ~RebindWidget().
|
private |
Definition at line 105 of file rebindwidget.h.
Referenced by applyChanges(), RebindWidget(), and setSelection().