Update kbm_gui.cpp

This commit is contained in:
tlarok 2025-04-02 19:52:03 +02:00 committed by GitHub
parent 814f1831cf
commit 835affacd2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -699,6 +699,7 @@ 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()) { if (timer && timer->isActive()) {
timer->stop(); timer->stop();
} }
@ -1008,7 +1009,6 @@ bool KBMSettings::eventFilter(QObject* obj, QEvent* event) {
if (timer && timer->isActive()) { if (timer && timer->isActive()) {
timer->stop(); timer->stop();
} }
switch (mouseEvent->button()) { switch (mouseEvent->button()) {
case Qt::LeftButton: case Qt::LeftButton:
buttonText = "leftbutton"; buttonText = "leftbutton";
@ -1025,6 +1025,7 @@ bool KBMSettings::eventFilter(QObject* obj, QEvent* event) {
if (!buttonText.isEmpty() && !mappinglist.contains(buttonText)) { if (!buttonText.isEmpty() && !mappinglist.contains(buttonText)) {
SetMapping(buttonText); // Add the key to the mapping list SetMapping(buttonText); // Add the key to the mapping list
} }
return true; return true;
} }
@ -1088,6 +1089,7 @@ bool KBMSettings::eventFilter(QObject* obj, QEvent* event) {
if (!WheelText.isEmpty() && !mappinglist.contains(WheelText)) { if (!WheelText.isEmpty() && !mappinglist.contains(WheelText)) {
SetMapping(WheelText); SetMapping(WheelText);
} }
EnableMapping = false; EnableMapping = false;
EnableMappingButtons(); EnableMappingButtons();
timer->stop(); timer->stop();