summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/core/hid/emulated_controller.cpp7
-rw-r--r--src/tests/common/scratch_buffer.cpp1
-rw-r--r--src/yuzu/configuration/configure_input_player.cpp12
-rw-r--r--src/yuzu/configuration/configure_input_player.h3
-rw-r--r--src/yuzu/configuration/configure_input_player.ui19
5 files changed, 19 insertions, 23 deletions
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp
index f238d6ccd..5587ee097 100644
--- a/src/core/hid/emulated_controller.cpp
+++ b/src/core/hid/emulated_controller.cpp
@@ -210,6 +210,13 @@ void EmulatedController::LoadTASParams() {
tas_stick_params[Settings::NativeAnalog::LStick].Set("axis_y", 1);
tas_stick_params[Settings::NativeAnalog::RStick].Set("axis_x", 2);
tas_stick_params[Settings::NativeAnalog::RStick].Set("axis_y", 3);
+
+ // set to optimal stick to avoid sanitizing the stick and tweaking the coordinates
+ // making sure they play back in the game as originally written down in the script file
+ tas_stick_params[Settings::NativeAnalog::LStick].Set("deadzone", 0.0f);
+ tas_stick_params[Settings::NativeAnalog::LStick].Set("range", 1.0f);
+ tas_stick_params[Settings::NativeAnalog::RStick].Set("deadzone", 0.0f);
+ tas_stick_params[Settings::NativeAnalog::RStick].Set("range", 1.0f);
}
void EmulatedController::LoadVirtualGamepadParams() {
diff --git a/src/tests/common/scratch_buffer.cpp b/src/tests/common/scratch_buffer.cpp
index b602c8d0a..f6e50da4a 100644
--- a/src/tests/common/scratch_buffer.cpp
+++ b/src/tests/common/scratch_buffer.cpp
@@ -3,6 +3,7 @@
#include <algorithm>
#include <array>
+#include <cstring>
#include <span>
#include <catch2/catch.hpp>
#include "common/common_types.h"
diff --git a/src/yuzu/configuration/configure_input_player.cpp b/src/yuzu/configuration/configure_input_player.cpp
index b1575b0d3..183cbe562 100644
--- a/src/yuzu/configuration/configure_input_player.cpp
+++ b/src/yuzu/configuration/configure_input_player.cpp
@@ -738,13 +738,10 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i
connect(ui->comboDevices, qOverload<int>(&QComboBox::activated), this,
&ConfigureInputPlayer::UpdateMappingWithDefaults);
+ ui->comboDevices->installEventFilter(this);
ui->comboDevices->setCurrentIndex(-1);
- ui->buttonRefreshDevices->setIcon(QIcon::fromTheme(QStringLiteral("view-refresh")));
- connect(ui->buttonRefreshDevices, &QPushButton::clicked,
- [this] { emit RefreshInputDevices(); });
-
timeout_timer->setSingleShot(true);
connect(timeout_timer.get(), &QTimer::timeout, [this] { SetPollingResult({}, true); });
@@ -1479,6 +1476,13 @@ void ConfigureInputPlayer::keyPressEvent(QKeyEvent* event) {
}
}
+bool ConfigureInputPlayer::eventFilter(QObject* object, QEvent* event) {
+ if (object == ui->comboDevices && event->type() == QEvent::MouseButtonPress) {
+ RefreshInputDevices();
+ }
+ return object->eventFilter(object, event);
+}
+
void ConfigureInputPlayer::CreateProfile() {
const auto profile_name =
LimitableInputDialog::GetText(this, tr("New Profile"), tr("Enter a profile name:"), 1, 30,
diff --git a/src/yuzu/configuration/configure_input_player.h b/src/yuzu/configuration/configure_input_player.h
index 26f60d121..6d1876f2b 100644
--- a/src/yuzu/configuration/configure_input_player.h
+++ b/src/yuzu/configuration/configure_input_player.h
@@ -119,6 +119,9 @@ private:
/// Handle key press events.
void keyPressEvent(QKeyEvent* event) override;
+ /// Handle combobox list refresh
+ bool eventFilter(QObject* object, QEvent* event) override;
+
/// Update UI to reflect current configuration.
void UpdateUI();
diff --git a/src/yuzu/configuration/configure_input_player.ui b/src/yuzu/configuration/configure_input_player.ui
index a62b57501..a9567c6ee 100644
--- a/src/yuzu/configuration/configure_input_player.ui
+++ b/src/yuzu/configuration/configure_input_player.ui
@@ -122,25 +122,6 @@
</property>
</widget>
</item>
- <item>
- <widget class="QPushButton" name="buttonRefreshDevices">
- <property name="minimumSize">
- <size>
- <width>21</width>
- <height>21</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>21</width>
- <height>21</height>
- </size>
- </property>
- <property name="styleSheet">
- <string notr="true"/>
- </property>
- </widget>
- </item>
</layout>
</widget>
</item>