summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorgerman77 <juangerman-13@hotmail.com>2021-10-25 03:28:54 +0200
committerNarr the Reg <juangerman-13@hotmail.com>2021-11-25 03:30:26 +0100
commitc6c32daf40ae1c720f0a2897c538bb1117371ea5 (patch)
tree26879cbeb2162e706086818ad501a8f2730206d5 /src/core
parentservice/hid: Fix memory allocated incorrectly (diff)
downloadyuzu-c6c32daf40ae1c720f0a2897c538bb1117371ea5.tar
yuzu-c6c32daf40ae1c720f0a2897c538bb1117371ea5.tar.gz
yuzu-c6c32daf40ae1c720f0a2897c538bb1117371ea5.tar.bz2
yuzu-c6c32daf40ae1c720f0a2897c538bb1117371ea5.tar.lz
yuzu-c6c32daf40ae1c720f0a2897c538bb1117371ea5.tar.xz
yuzu-c6c32daf40ae1c720f0a2897c538bb1117371ea5.tar.zst
yuzu-c6c32daf40ae1c720f0a2897c538bb1117371ea5.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hid/emulated_controller.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp
index bd0b89c05..48add394b 100644
--- a/src/core/hid/emulated_controller.cpp
+++ b/src/core/hid/emulated_controller.cpp
@@ -122,6 +122,7 @@ void EmulatedController::ReloadInput() {
Input::InputCallback button_callback{
[this, index](Input::CallbackStatus callback) { SetButton(callback, index); }};
button_devices[index]->SetCallback(button_callback);
+ button_devices[index]->ForceUpdate();
}
for (std::size_t index = 0; index < stick_devices.size(); ++index) {
@@ -131,6 +132,7 @@ void EmulatedController::ReloadInput() {
Input::InputCallback stick_callback{
[this, index](Input::CallbackStatus callback) { SetStick(callback, index); }};
stick_devices[index]->SetCallback(stick_callback);
+ stick_devices[index]->ForceUpdate();
}
for (std::size_t index = 0; index < trigger_devices.size(); ++index) {
@@ -140,6 +142,7 @@ void EmulatedController::ReloadInput() {
Input::InputCallback trigger_callback{
[this, index](Input::CallbackStatus callback) { SetTrigger(callback, index); }};
trigger_devices[index]->SetCallback(trigger_callback);
+ trigger_devices[index]->ForceUpdate();
}
for (std::size_t index = 0; index < battery_devices.size(); ++index) {
@@ -149,6 +152,7 @@ void EmulatedController::ReloadInput() {
Input::InputCallback battery_callback{
[this, index](Input::CallbackStatus callback) { SetBattery(callback, index); }};
battery_devices[index]->SetCallback(battery_callback);
+ battery_devices[index]->ForceUpdate();
}
for (std::size_t index = 0; index < motion_devices.size(); ++index) {
@@ -158,6 +162,7 @@ void EmulatedController::ReloadInput() {
Input::InputCallback motion_callback{
[this, index](Input::CallbackStatus callback) { SetMotion(callback, index); }};
motion_devices[index]->SetCallback(motion_callback);
+ motion_devices[index]->ForceUpdate();
}
}
@@ -843,6 +848,10 @@ AnalogSticks EmulatedController::GetSticks() const {
if (is_configuring) {
return {};
}
+ // Some drivers like stick from buttons need constant refreshing
+ for (auto& device : stick_devices) {
+ device->SoftUpdate();
+ }
return controller.analog_stick_state;
}