mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-28 04:54:30 +00:00
Update kbm_gui.cpp
This commit is contained in:
parent
000e7cb028
commit
928e395e09
@ -699,7 +699,10 @@ bool KBMSettings::eventFilter(QObject* obj, QEvent* event) {
|
|||||||
if (event->type() == QEvent::KeyPress) {
|
if (event->type() == QEvent::KeyPress) {
|
||||||
QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
|
QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
|
||||||
QString keyText;
|
QString keyText;
|
||||||
|
if (timer && timer->isActive()) {
|
||||||
|
timer->stop();
|
||||||
|
}
|
||||||
|
|
||||||
switch (keyEvent->key()) {
|
switch (keyEvent->key()) {
|
||||||
case Qt::Key_Space:
|
case Qt::Key_Space:
|
||||||
keyText = "space";
|
keyText = "space";
|
||||||
@ -992,11 +995,7 @@ bool KBMSettings::eventFilter(QObject* obj, QEvent* event) {
|
|||||||
EnableMappingButtons();
|
EnableMappingButtons();
|
||||||
timer->stop();
|
timer->stop();
|
||||||
|
|
||||||
if (modifier != "") {
|
MappingButton->setText(mapping);
|
||||||
MappingButton->setText(modifier + "," + mapping);
|
|
||||||
} else {
|
|
||||||
MappingButton->setText(mapping);
|
|
||||||
}
|
|
||||||
|
|
||||||
mappinglist.clear(); // Clear the list for the next mapping
|
mappinglist.clear(); // Clear the list for the next mapping
|
||||||
return true;
|
return true;
|
||||||
@ -1005,6 +1004,11 @@ bool KBMSettings::eventFilter(QObject* obj, QEvent* event) {
|
|||||||
if (event->type() == QEvent::MouseButtonPress) {
|
if (event->type() == QEvent::MouseButtonPress) {
|
||||||
QMouseEvent* mouseEvent = static_cast<QMouseEvent*>(event);
|
QMouseEvent* mouseEvent = static_cast<QMouseEvent*>(event);
|
||||||
QString buttonText;
|
QString buttonText;
|
||||||
|
|
||||||
|
if (timer && timer->isActive()) {
|
||||||
|
timer->stop();
|
||||||
|
}
|
||||||
|
|
||||||
switch (mouseEvent->button()) {
|
switch (mouseEvent->button()) {
|
||||||
case Qt::LeftButton:
|
case Qt::LeftButton:
|
||||||
buttonText = "leftbutton";
|
buttonText = "leftbutton";
|
||||||
@ -1018,6 +1022,9 @@ bool KBMSettings::eventFilter(QObject* obj, QEvent* event) {
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (!buttonText.isEmpty() && !mappinglist.contains(buttonText)) {
|
||||||
|
SetMapping(buttonText); // Add the key to the mapping list
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1026,11 +1033,7 @@ bool KBMSettings::eventFilter(QObject* obj, QEvent* event) {
|
|||||||
EnableMappingButtons();
|
EnableMappingButtons();
|
||||||
timer->stop();
|
timer->stop();
|
||||||
|
|
||||||
if (modifier != "") {
|
MappingButton->setText(mapping);
|
||||||
MappingButton->setText(modifier + "," + mapping);
|
|
||||||
} else {
|
|
||||||
MappingButton->setText(mapping);
|
|
||||||
}
|
|
||||||
|
|
||||||
mappinglist.clear(); // Clear the list for the next mapping
|
mappinglist.clear(); // Clear the list for the next mapping
|
||||||
return true;
|
return true;
|
||||||
@ -1082,6 +1085,15 @@ bool KBMSettings::eventFilter(QObject* obj, QEvent* event) {
|
|||||||
tr("Mousewheel cannot be mapped to stick outputs"));
|
tr("Mousewheel cannot be mapped to stick outputs"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!WheelText.isEmpty() && !mappinglist.contains(WheelText)) {
|
||||||
|
SetMapping(WheelText);
|
||||||
|
}
|
||||||
|
EnableMapping = false;
|
||||||
|
EnableMappingButtons();
|
||||||
|
timer->stop();
|
||||||
|
MappingButton->setText(mapping);
|
||||||
|
mappinglist.clear();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user