mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-15 06:58:37 +02:00
DolphinQt: Add setting to enable iterative input mappings.
This commit is contained in:
@ -11,8 +11,6 @@
|
||||
#include "DolphinQt/Config/Mapping/IOWindow.h"
|
||||
#include "DolphinQt/Config/Mapping/MappingWidget.h"
|
||||
#include "DolphinQt/Config/Mapping/MappingWindow.h"
|
||||
#include "DolphinQt/QtUtils/BlockUserInputFilter.h"
|
||||
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
|
||||
|
||||
#include "InputCommon/ControlReference/ControlReference.h"
|
||||
#include "InputCommon/ControllerEmu/ControllerEmu.h"
|
||||
@ -67,15 +65,10 @@ static QString RefToDisplayString(ControlReference* ref)
|
||||
return expression;
|
||||
}
|
||||
|
||||
bool MappingButton::IsInput() const
|
||||
{
|
||||
return m_reference->IsInput();
|
||||
}
|
||||
|
||||
MappingButton::MappingButton(MappingWidget* parent, ControlReference* ref)
|
||||
: ElidedButton(RefToDisplayString(ref)), m_mapping_window(parent->GetParent()), m_reference(ref)
|
||||
{
|
||||
if (IsInput())
|
||||
if (m_reference->IsInput())
|
||||
{
|
||||
setToolTip(
|
||||
tr("Left-click to detect input.\nMiddle-click to clear.\nRight-click for more options."));
|
||||
@ -88,10 +81,8 @@ MappingButton::MappingButton(MappingWidget* parent, ControlReference* ref)
|
||||
connect(this, &MappingButton::clicked, this, &MappingButton::Clicked);
|
||||
|
||||
connect(parent, &MappingWidget::ConfigChanged, this, &MappingButton::ConfigChanged);
|
||||
connect(this, &MappingButton::ConfigChanged, [this] {
|
||||
setText(RefToDisplayString(m_reference));
|
||||
m_is_mapping = false;
|
||||
});
|
||||
connect(this, &MappingButton::ConfigChanged,
|
||||
[this] { setText(RefToDisplayString(m_reference)); });
|
||||
}
|
||||
|
||||
void MappingButton::AdvancedPressed()
|
||||
@ -114,7 +105,6 @@ void MappingButton::Clicked()
|
||||
return;
|
||||
}
|
||||
|
||||
m_is_mapping = true;
|
||||
m_mapping_window->QueueInputDetection(this);
|
||||
}
|
||||
|
||||
@ -131,14 +121,6 @@ void MappingButton::Clear()
|
||||
m_mapping_window->UnQueueInputDetection(this);
|
||||
}
|
||||
|
||||
void MappingButton::StartMapping()
|
||||
{
|
||||
// Focus just makes it more clear which button is currently being mapped.
|
||||
setFocus();
|
||||
setText(tr("[ Press Now ]"));
|
||||
QtUtils::InstallKeyboardBlocker(this, this, &MappingButton::ConfigChanged);
|
||||
}
|
||||
|
||||
void MappingButton::mouseReleaseEvent(QMouseEvent* event)
|
||||
{
|
||||
switch (event->button())
|
||||
|
Reference in New Issue
Block a user