Skip to content
Permalink
Browse files

DolphinQt: Fix spacebar not activating output mapping buttons.

  • Loading branch information...
jordan-woyak committed Nov 4, 2019
1 parent 0f4c971 commit 1bdf43dd78ac5b0ffdd6e5bdf3290166502b39f3
@@ -56,7 +56,7 @@ MappingButton::MappingButton(MappingWidget* parent, ControlReference* ref, bool
setToolTip(
tr("Left-click to detect input.\nMiddle-click to clear.\nRight-click for more options."));

connect(this, &MappingButton::clicked, this, &MappingButton::Detect);
connect(this, &MappingButton::clicked, this, &MappingButton::Clicked);

if (indicator)
connect(parent, &MappingWidget::Update, this, &MappingButton::UpdateIndicator);
@@ -74,10 +74,13 @@ void MappingButton::AdvancedPressed()
m_parent->SaveSettings();
}

void MappingButton::Detect()
void MappingButton::Clicked()
{
if (!m_reference->IsInput())
{
AdvancedPressed();
return;
}

const auto default_device_qualifier = m_parent->GetController()->GetDefaultDevice();

@@ -141,19 +144,14 @@ void MappingButton::mouseReleaseEvent(QMouseEvent* event)
{
switch (event->button())
{
case Qt::MouseButton::LeftButton:
if (m_reference->IsInput())
QPushButton::mouseReleaseEvent(event);
else
AdvancedPressed();
return;
case Qt::MouseButton::MidButton:
Clear();
return;
case Qt::MouseButton::RightButton:
AdvancedPressed();
return;
default:
QPushButton::mouseReleaseEvent(event);
return;
}
}
@@ -18,7 +18,6 @@ class MappingButton : public ElidedButton
public:
MappingButton(MappingWidget* widget, ControlReference* ref, bool indicator);

void Detect();
bool IsInput() const;

private:
@@ -27,6 +26,7 @@ class MappingButton : public ElidedButton
void ConfigChanged();
void AdvancedPressed();

void Clicked();
void mouseReleaseEvent(QMouseEvent* event) override;

MappingWidget* m_parent;

0 comments on commit 1bdf43d

Please sign in to comment.
You can’t perform that action at this time.