@@ -7,8 +7,6 @@ ConfigWindow::ConfigWindow(QWidget *parent, TouchScreen *ts) : QDialog(parent)
77 this ->setWindowFlags (Qt::CustomizeWindowHint | Qt::WindowTitleHint);
88 this ->setWindowTitle (tr (" InputRedirectionClient-Qt - Button Config" ));
99
10- layout = new QVBoxLayout (this );
11-
1210 comboBoxA = populateItems (variantToButton (settings.value (" ButtonA" , QGamepadManager::ButtonA)));
1311 comboBoxB = populateItems (variantToButton (settings.value (" ButtonB" , QGamepadManager::ButtonB)));
1412 comboBoxX = populateItems (variantToButton (settings.value (" ButtonX" , QGamepadManager::ButtonX)));
@@ -28,6 +26,8 @@ ConfigWindow::ConfigWindow(QWidget *parent, TouchScreen *ts) : QDialog(parent)
2826 comboBoxPowerLong = populateItems (variantToButton (settings.value (" ButtonPowerLong" , QGamepadManager::ButtonInvalid)));
2927 comboBoxTouch1 = populateItems (variantToButton (settings.value (" ButtonT1" , QGamepadManager::ButtonInvalid)));
3028 comboBoxTouch2 = populateItems (variantToButton (settings.value (" ButtonT2" , QGamepadManager::ButtonInvalid)));
29+ comboBoxTouch3 = populateItems (variantToButton (settings.value (" ButtonT3" , QGamepadManager::ButtonInvalid)));
30+ comboBoxTouch4 = populateItems (variantToButton (settings.value (" ButtonT4" , QGamepadManager::ButtonInvalid)));
3131
3232 touchButton1XEdit = new QLineEdit (this );
3333 touchButton1XEdit->setClearButtonEnabled (true );
@@ -43,51 +43,109 @@ ConfigWindow::ConfigWindow(QWidget *parent, TouchScreen *ts) : QDialog(parent)
4343 touchButton2YEdit->setClearButtonEnabled (true );
4444 touchButton2YEdit->setText (settings.value (" touchButton2Y" , " 0" ).toString ());
4545
46+ touchButton3XEdit = new QLineEdit (this );
47+ touchButton3XEdit->setClearButtonEnabled (true );
48+ touchButton3XEdit->setText (settings.value (" touchButton3X" , " 0" ).toString ());
49+ touchButton3YEdit = new QLineEdit (this );
50+ touchButton3YEdit->setClearButtonEnabled (true );
51+ touchButton3YEdit->setText (settings.value (" touchButton3Y" , " 0" ).toString ());
52+
53+ touchButton4XEdit = new QLineEdit (this );
54+ touchButton4XEdit->setClearButtonEnabled (true );
55+ touchButton4XEdit->setText (settings.value (" touchButton4X" , " 0" ).toString ());
56+ touchButton4YEdit = new QLineEdit (this );
57+ touchButton4YEdit->setClearButtonEnabled (true );
58+ touchButton4YEdit->setText (settings.value (" touchButton4Y" , " 0" ).toString ());
59+
4660 invertYCheckbox = new QCheckBox (this );
4761 invertYCppCheckbox = new QCheckBox (this );
4862 swapSticksCheckbox = new QCheckBox (this );
4963 mhCameraCheckbox = new QCheckBox (this );
5064 rsSmashCheckbox = new QCheckBox (this );
5165
52- formLayout = new QFormLayout;
53-
54- formLayout->addRow (tr (" A Button" ), comboBoxA);
55- formLayout->addRow (tr (" B Button" ), comboBoxB);
56- formLayout->addRow (tr (" X Button" ), comboBoxX);
57- formLayout->addRow (tr (" Y Button" ), comboBoxY);
58- formLayout->addRow (tr (" DPad-Up" ), comboBoxUp);
59- formLayout->addRow (tr (" DPad-Down" ), comboBoxDown);
60- formLayout->addRow (tr (" DPad-Left" ), comboBoxLeft);
61- formLayout->addRow (tr (" DPad-Right" ), comboBoxRight);
62- formLayout->addRow (tr (" L Button" ), comboBoxL);
63- formLayout->addRow (tr (" R Button" ), comboBoxR);
64- formLayout->addRow (tr (" Select" ), comboBoxSelect);
65- formLayout->addRow (tr (" Start" ), comboBoxStart);
66- formLayout->addRow (tr (" Home" ), comboBoxHome);
67- formLayout->addRow (tr (" Power" ), comboBoxPower);
68- formLayout->addRow (tr (" Power-Long" ), comboBoxPowerLong);
69- formLayout->addRow (tr (" ZL Button" ), comboBoxZL);
70- formLayout->addRow (tr (" ZR Button" ), comboBoxZR);
71-
72- formLayout->addRow (tr (" Touch Button 1" ), comboBoxTouch1);
73- formLayout->addRow (tr (" Touch Button X" ), touchButton1XEdit);
74- formLayout->addRow (tr (" Touch Button Y" ), touchButton1YEdit);
75- formLayout->addRow (tr (" Touch Button 2" ), comboBoxTouch2);
76- formLayout->addRow (tr (" Touch Button X" ), touchButton2XEdit);
77- formLayout->addRow (tr (" Touch Button Y" ), touchButton2YEdit);
78-
79- formLayout->addRow (tr (" &Invert Y axis" ), invertYCheckbox);
80- formLayout->addRow (tr (" &Invert Cpp Y " ), invertYCppCheckbox);
81- formLayout->addRow (tr (" &Swap Sticks" ), swapSticksCheckbox);
82- formLayout->addRow (tr (" RightStick &DPad" ), mhCameraCheckbox);
83- formLayout->addRow (tr (" RightStick &Smash" ), rsSmashCheckbox);
84-
8566 saveButton = new QPushButton (tr (" &SAVE" ), this );
8667 closeButton = new QPushButton (tr (" &CANCEL" ), this );
8768
88- layout->addLayout (formLayout);
89- layout->addWidget (saveButton);
90- layout->addWidget (closeButton);
69+ layout = new QGridLayout (this );
70+
71+ layout->addWidget (new QLabel (" Y Button" ), 0 , 0 );
72+ layout->addWidget (comboBoxY, 0 , 1 );
73+ layout->addWidget (new QLabel (" X Button" ), 0 , 2 );
74+ layout->addWidget (comboBoxX, 0 , 3 );
75+ layout->addWidget (new QLabel (" B Button" ), 1 , 0 );
76+ layout->addWidget (comboBoxB, 1 , 1 );
77+ layout->addWidget (new QLabel (" A Button" ), 1 , 2 );
78+ layout->addWidget (comboBoxA, 1 , 3 );
79+
80+ layout->addWidget (new QLabel (" DPad-Down" ), 2 , 0 );
81+ layout->addWidget (comboBoxDown, 2 , 1 );
82+ layout->addWidget (new QLabel (" DPad-Up" ), 2 , 2 );
83+ layout->addWidget (comboBoxUp, 2 , 3 );
84+ layout->addWidget (new QLabel (" DPad-Left" ), 3 , 0 );
85+ layout->addWidget (comboBoxLeft, 3 , 1 );
86+ layout->addWidget (new QLabel (" DPad-Right" ), 3 , 2 );
87+ layout->addWidget (comboBoxRight, 3 , 3 );
88+
89+ layout->addWidget (new QLabel (" L Button" ), 4 , 0 );
90+ layout->addWidget (comboBoxL, 4 , 1 );
91+ layout->addWidget (new QLabel (" R Button" ), 4 , 2 );
92+ layout->addWidget (comboBoxR, 4 , 3 );
93+ layout->addWidget (new QLabel (" ZL Button" ), 5 , 0 );
94+ layout->addWidget (comboBoxZL, 5 , 1 );
95+ layout->addWidget (new QLabel (" ZR Button" ), 5 , 2 );
96+ layout->addWidget (comboBoxZR, 5 , 3 );
97+
98+ layout->addWidget (new QLabel (" Select" ), 6 , 0 );
99+ layout->addWidget (comboBoxSelect, 6 , 1 );
100+ layout->addWidget (new QLabel (" Start" ), 6 , 2 );
101+ layout->addWidget (comboBoxStart, 6 , 3 );
102+
103+ layout->addWidget (new QLabel (" Power Button" ), 7 , 0 );
104+ layout->addWidget (comboBoxPower, 7 , 1 );
105+ layout->addWidget (new QLabel (" Power-Long" ), 7 , 2 );
106+ layout->addWidget (comboBoxPowerLong, 7 , 3 );
107+ layout->addWidget (new QLabel (" Home Button" ), 8 , 0 , 1 , 2 );
108+ layout->addWidget (comboBoxHome, 8 , 1 , 1 , 2 );
109+
110+ layout->addWidget (new QLabel (" Invert Y axis" ), 17 , 0 );
111+ layout->addWidget (invertYCheckbox, 17 , 1 );
112+ layout->addWidget (new QLabel (" Invert CPP Y" ), 17 , 2 );
113+ layout->addWidget (invertYCppCheckbox, 17 , 3 );
114+ layout->addWidget (new QLabel (" Swap CPads" ), 18 , 2 );
115+ layout->addWidget (swapSticksCheckbox, 18 , 3 );
116+
117+ layout->addWidget (new QLabel (" RS as DPad" ), 19 , 0 );
118+ layout->addWidget (mhCameraCheckbox, 19 , 1 );
119+ layout->addWidget (new QLabel (" RS as Smash" ), 19 , 2 );
120+ layout->addWidget (rsSmashCheckbox, 19 , 3 );
121+
122+ layout->addWidget (new QLabel (" Touch R" ), 9 , 0 , 1 , 2 );
123+ layout->addWidget (comboBoxTouch1, 9 , 1 , 1 , 2 );
124+ layout->addWidget (new QLabel (" X" ), 10 , 0 );
125+ layout->addWidget (touchButton1XEdit, 10 , 1 );
126+ layout->addWidget (new QLabel (" Y" ), 10 , 2 );
127+ layout->addWidget (touchButton1YEdit, 10 , 3 );
128+ layout->addWidget (new QLabel (" Touch B" ), 11 , 0 , 1 , 2 );
129+ layout->addWidget (comboBoxTouch2, 11 , 1 , 1 , 2 );
130+ layout->addWidget (new QLabel (" X" ), 12 , 0 );
131+ layout->addWidget (touchButton2XEdit, 12 , 1 );
132+ layout->addWidget (new QLabel (" Y" ), 12 , 2 );
133+ layout->addWidget (touchButton2YEdit, 12 , 3 );
134+ layout->addWidget (new QLabel (" Touch G" ), 13 , 0 , 1 , 2 );
135+ layout->addWidget (comboBoxTouch3, 13 , 1 , 1 , 2 );
136+ layout->addWidget (new QLabel (" X" ), 14 , 0 );
137+ layout->addWidget (touchButton3XEdit, 14 , 1 );
138+ layout->addWidget (new QLabel (" Y" ), 14 , 2 );
139+ layout->addWidget (touchButton3YEdit, 14 , 3 );
140+ layout->addWidget (new QLabel (" Touch Y" ), 15 , 0 , 1 , 2 );
141+ layout->addWidget (comboBoxTouch4, 15 , 1 , 1 , 2 );
142+ layout->addWidget (new QLabel (" X" ), 16 , 0 );
143+ layout->addWidget (touchButton4XEdit, 16 , 1 );
144+ layout->addWidget (new QLabel (" Y" ), 16 , 2 );
145+ layout->addWidget (touchButton4YEdit, 16 , 3 );
146+
147+ layout->addWidget (saveButton, 20 , 0 , 1 , 2 );
148+ layout->addWidget (closeButton, 20 , 2 , 1 , 2 );
91149
92150 connect (touchButton1XEdit, &QLineEdit::textChanged, this ,
93151 [ts](const QString &text)
@@ -113,6 +171,30 @@ ConfigWindow::ConfigWindow(QWidget *parent, TouchScreen *ts) : QDialog(parent)
113171 touchButton2Y = text.toUInt ();
114172 settings.setValue (" touchButton2Y" , text);
115173 });
174+ connect (touchButton3XEdit, &QLineEdit::textChanged, this ,
175+ [ts](const QString &text)
176+ {
177+ touchButton3X = text.toUInt ();
178+ settings.setValue (" touchButton3X" , text);
179+ });
180+ connect (touchButton3YEdit, &QLineEdit::textChanged, this ,
181+ [ts](const QString &text)
182+ {
183+ touchButton3Y = text.toUInt ();
184+ settings.setValue (" touchButton3Y" , text);
185+ });
186+ connect (touchButton4XEdit, &QLineEdit::textChanged, this ,
187+ [ts](const QString &text)
188+ {
189+ touchButton4X = text.toUInt ();
190+ settings.setValue (" touchButton4X" , text);
191+ });
192+ connect (touchButton4YEdit, &QLineEdit::textChanged, this ,
193+ [ts](const QString &text)
194+ {
195+ touchButton4Y = text.toUInt ();
196+ settings.setValue (" touchButton4Y" , text);
197+ });
116198
117199 connect (invertYCheckbox, &QCheckBox::stateChanged, this ,
118200 [](int state)
@@ -266,6 +348,13 @@ ConfigWindow::ConfigWindow(QWidget *parent, TouchScreen *ts) : QDialog(parent)
266348 QGamepadManager::GamepadButton t2 = variantToButton (currentData (comboBoxTouch2));
267349 touchButton2 = t2;
268350 settings.setValue (" ButtonT2" , t2);
351+ QGamepadManager::GamepadButton t3 = variantToButton (currentData (comboBoxTouch3));
352+ touchButton3 = t3;
353+ settings.setValue (" ButtonT3" , t3);
354+ QGamepadManager::GamepadButton t4 = variantToButton (currentData (comboBoxTouch4));
355+ touchButton4 = t4;
356+ settings.setValue (" ButtonT4" , t4);
357+
269358 ts->updatePixmap ();
270359
271360 });
@@ -285,20 +374,20 @@ ConfigWindow::ConfigWindow(QWidget *parent, TouchScreen *ts) : QDialog(parent)
285374QComboBox* ConfigWindow::populateItems (QGamepadManager::GamepadButton button)
286375{
287376 QComboBox *comboBox = new QComboBox ();
288- comboBox->addItem (" A (bottom)" , QGamepadManager::ButtonA);
289- comboBox->addItem (" B (right)" , QGamepadManager::ButtonB);
290- comboBox->addItem (" X (left)" , QGamepadManager::ButtonX);
291- comboBox->addItem (" Y (top)" , QGamepadManager::ButtonY);
292- comboBox->addItem (" Right" , QGamepadManager::ButtonRight);
293- comboBox->addItem (" Left" , QGamepadManager::ButtonLeft);
377+ comboBox->addItem (" A" , QGamepadManager::ButtonA);
378+ comboBox->addItem (" B" , QGamepadManager::ButtonB);
379+ comboBox->addItem (" X" , QGamepadManager::ButtonX);
380+ comboBox->addItem (" Y" , QGamepadManager::ButtonY);
294381 comboBox->addItem (" Up" , QGamepadManager::ButtonUp);
295382 comboBox->addItem (" Down" , QGamepadManager::ButtonDown);
296- comboBox->addItem (" RB" , QGamepadManager::ButtonR1);
383+ comboBox->addItem (" Right" , QGamepadManager::ButtonRight);
384+ comboBox->addItem (" Left" , QGamepadManager::ButtonLeft);
297385 comboBox->addItem (" LB" , QGamepadManager::ButtonL1);
298- comboBox->addItem (" Select" , QGamepadManager::ButtonSelect);
299- comboBox->addItem (" Start" , QGamepadManager::ButtonStart);
300- comboBox->addItem (" RT" , QGamepadManager::ButtonR2);
386+ comboBox->addItem (" RB" , QGamepadManager::ButtonR1);
301387 comboBox->addItem (" LT" , QGamepadManager::ButtonL2);
388+ comboBox->addItem (" RT" , QGamepadManager::ButtonR2);
389+ comboBox->addItem (" Start" , QGamepadManager::ButtonStart);
390+ comboBox->addItem (" Back" , QGamepadManager::ButtonSelect);
302391 comboBox->addItem (" L3" , QGamepadManager::ButtonL3);
303392 comboBox->addItem (" R3" , QGamepadManager::ButtonR3);
304393 comboBox->addItem (" Guide" , QGamepadManager::ButtonGuide);
0 commit comments