Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions core/input/gamepad_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ bool GamepadDevice::detectAxis(u32 code, int value)
//
bool GamepadDevice::gamepad_axis_input(u32 code, int value)
{
lastRawAxisValues[code] = value;
if (detectAxis(code, value))
return true;

Expand Down Expand Up @@ -670,6 +671,8 @@ void GamepadDevice::detectInput(bool combo, input_detected_cb input_changed)
_detection_start_time = getTimeMs() + 200;
detectionInputs.clear();
detectingAxes.clear();
for (const auto& [code, value] : lastRawAxisValues)
detectingAxes.emplace(code, value);
}

#ifdef TEST_AUTOMATION
Expand Down
1 change: 1 addition & 0 deletions core/input/gamepad_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ class GamepadDevice
bool _is_registered = false;
u32 digitalToAnalogState[4];
std::unordered_map<DreamcastKey, int> lastAxisValue[4];
std::unordered_map<u32, int> lastRawAxisValues;
bool perGameMapping = false;
bool instanceMapping = false;

Expand Down
Loading