ckb-next  v0.2.8 at branch master
ckb-next driver for corsair devices
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rebindwidget.h
Go to the documentation of this file.
1 #ifndef REBINDWIDGET_H
2 #define REBINDWIDGET_H
3 
4 #include <QWidget>
5 #include "kbbind.h"
6 #include "kbprofile.h"
7 #include "macroreader.h"
8 
9 // Key rebinding widget
10 
11 namespace Ui {
12 class RebindWidget;
13 }
14 
15 class RebindWidget : public QWidget
16 {
17  Q_OBJECT
18 
19 public:
20  explicit RebindWidget(QWidget* parent);
21  ~RebindWidget();
22 
23  // Sets current binding setup
24  void setBind(KbBind* newBind, KbProfile* newProfile);
25  // Sets current selection (chooses keys to rebind)
26  void setSelection(const QStringList& newSelection, bool applyPrevious = false);
27 
28 private slots:
29  void applyChanges(const QStringList& keys, bool doUnbind);
34 
35  void on_typingBox_currentIndexChanged(int index);
36  void on_modBox_currentIndexChanged(int index);
37  void on_fnBox_currentIndexChanged(int index);
38  void on_numBox_currentIndexChanged(int index);
39  void on_mediaBox_currentIndexChanged(int index);
40  void on_mbBox_currentIndexChanged(int index);
41  void on_mb2Box_currentIndexChanged(int index);
42  void on_wheelBox_currentIndexChanged(int index);
43  void on_dpiBox_currentIndexChanged(int index);
44  void on_modeBox_currentIndexChanged(int index);
45  void on_lightBox_currentIndexChanged(int index);
46  void on_lockBox_currentIndexChanged(int index);
47  void on_programKpBox_textChanged(const QString &arg1);
48  void on_programKrBox_textChanged(const QString &arg1);
49  void on_animBox_currentIndexChanged(int index);
50 
51  void on_typingButton_clicked(bool checked);
52  void on_modButton_clicked(bool checked);
53  void on_fnButton_clicked(bool checked);
54  void on_numButton_clicked(bool checked);
55  void on_mediaButton_clicked(bool checked);
56  void on_mbButton_clicked(bool checked);
57  void on_mb2Button_clicked(bool checked);
58  void on_wheelButton_clicked(bool checked);
59  void on_dpiButton_clicked(bool checked);
60  void on_modeButton_clicked(bool checked);
61  void on_lightButton_clicked(bool checked);
62  void on_lockButton_clicked(bool checked);
63  void on_programKpButton_clicked(bool checked);
64  void on_programKrButton_clicked(bool checked);
65  void on_programKpSIBox_clicked(bool checked);
66  void on_programKrSIBox_clicked(bool checked);
67  void on_animButton_clicked(bool checked);
72 
73  void on_rb_delay_no_toggled(bool checked);
74 
75  void on_rb_delay_asTyped_toggled(bool checked);
76 
77  void on_rb_delay_default_toggled(bool checked);
78 
79 private:
81 
82  // Tab indices
83  const static int TAB_KB = 0, TAB_MOUSE = 1, TAB_ANIM = 2, TAB_SPECIAL = 3, TAB_PROGRAM = 4, TAB_MACRO = 5;
84 
85  void setBox(QWidget* box);
86 
87  // convert keyboard definion into macro definition
88  void convertMacroBox();
89  // Show some help info
90  void helpStatus(int status);
91 
92  void setCorrectRadioButton (QString macdef);
93 
96  QStringList selection;
97 
98  QStringList typingKeys;
99  QStringList modKeys;
100  QStringList fnKeys;
101  QStringList numKeys;
102  QStringList mediaKeys;
103  QStringList mouseKeys;
104  QStringList mouseExtKeys;
105  QStringList wheelKeys;
107 };
108 
109 #endif // REBINDWIDGET_H
void on_applyButton_clicked()
void on_wheelBox_currentIndexChanged(int index)
RebindWidget(QWidget *parent)
Definition: rebindwidget.cpp:9
void on_mediaButton_clicked(bool checked)
void on_wheelButton_clicked(bool checked)
void on_modBox_currentIndexChanged(int index)
void on_lockButton_clicked(bool checked)
void on_btnClearMacro_clicked()
RebindWidget::on_btnClearMacro_clicked changes the help info an the panel. The job of clearing the in...
QStringList wheelKeys
Definition: rebindwidget.h:105
KbBind * bind
Definition: rebindwidget.h:94
QStringList mouseExtKeys
Definition: rebindwidget.h:104
The MacroReader class creates a worker thread object. It does a connect do delayed deletion of thread...
Definition: macroreader.h:87
void on_fnBox_currentIndexChanged(int index)
void on_numButton_clicked(bool checked)
void on_modeButton_clicked(bool checked)
void on_btnStopMacro_clicked()
RebindWidget::on_btnStopMacro_clicked ends the macro recording. Notify channel ist closed...
void on_cancelButton_clicked()
void on_lightButton_clicked(bool checked)
void setBox(QWidget *box)
void on_pteMacroBox_textChanged()
void on_resetButton_clicked()
static const int TAB_SPECIAL
Definition: rebindwidget.h:83
void on_typingBox_currentIndexChanged(int index)
void on_unbindButton_clicked()
void on_modeBox_currentIndexChanged(int index)
void on_fnButton_clicked(bool checked)
static const int TAB_MOUSE
Definition: rebindwidget.h:83
static const int TAB_PROGRAM
Definition: rebindwidget.h:83
QStringList mediaKeys
Definition: rebindwidget.h:102
void on_programKpSIBox_clicked(bool checked)
QStringList mouseKeys
Definition: rebindwidget.h:103
QStringList typingKeys
Definition: rebindwidget.h:98
void on_btnStartMacro_clicked()
RebindWidget::on_btnStartMacro_clicked starts macro recording. A new notification channel and MacroRe...
void on_mediaBox_currentIndexChanged(int index)
void on_programKrSIBox_clicked(bool checked)
void on_rb_delay_asTyped_toggled(bool checked)
RebindWidget::on_rb_delay_asTyped_toggled.
KbProfile * profile
Definition: rebindwidget.h:95
void on_programKpButton_clicked(bool checked)
void on_mb2Button_clicked(bool checked)
void setCorrectRadioButton(QString macdef)
RebindWidget::setCorrectRadioButton.
static const int TAB_MACRO
Definition: rebindwidget.h:83
void on_dpiBox_currentIndexChanged(int index)
void on_programKrButton_clicked(bool checked)
void on_modButton_clicked(bool checked)
void on_typingButton_clicked(bool checked)
Definition: kbbind.h:20
void convertMacroBox()
RebindWidget::convertMacroBox converts the macroBox content. The KB sends each keypress as "key [+|-]...
static const int TAB_ANIM
Definition: rebindwidget.h:83
void on_mbBox_currentIndexChanged(int index)
QStringList selection
Definition: rebindwidget.h:96
void on_programKrBox_textChanged(const QString &arg1)
Ui::RebindWidget * ui
Definition: rebindwidget.h:80
QStringList modKeys
Definition: rebindwidget.h:99
void helpStatus(int status)
RebindWidget::helpStatus shows a help line in the ui.
MacroReader * macReader
macReader holds the MacroReader when macro recording starts.
Definition: rebindwidget.h:106
QStringList fnKeys
Definition: rebindwidget.h:100
void on_numBox_currentIndexChanged(int index)
void on_rb_delay_no_toggled(bool checked)
RebindWidget::on_rb_delay_no_toggled.
void on_mb2Box_currentIndexChanged(int index)
void setSelection(const QStringList &newSelection, bool applyPrevious=false)
QStringList numKeys
Definition: rebindwidget.h:101
void on_lightBox_currentIndexChanged(int index)
static const int TAB_KB
Definition: rebindwidget.h:83
void applyChanges(const QStringList &keys, bool doUnbind)
void on_programKpBox_textChanged(const QString &arg1)
void on_lockBox_currentIndexChanged(int index)
void on_dpiButton_clicked(bool checked)
void setBind(KbBind *newBind, KbProfile *newProfile)
void on_rb_delay_default_toggled(bool checked)
RebindWidget::on_rb_delay_default_toggled.
void on_animBox_currentIndexChanged(int index)
void on_mbButton_clicked(bool checked)
void on_animButton_clicked(bool checked)