Files
PDModdingCommunity_PD-Loader/source-code/source/plugins/TLAC/Components/Input/TouchSliderState.cpp
T
somewhatlurker 22047cec12 TLAC slider emulator: more directly emulate input data to avoid tracking section state, testing for ps4 official controller slider support
also allow slider in menu (toggle in keyconfig) and remove need for hardware slider disabling patch (patches/launcher)
2020-08-11 00:55:20 +10:00

26 lines
590 B
C++

#include "TouchSliderState.h"
namespace TLAC::Components
{
void TouchSliderState::SetSensor(int index, int value)
{
if (index < 0 || index >= SLIDER_SENSORS)
return;
uint32_t* ph = SerialState->sliderSerialResponse.sensors[index].pressureHistory;
ph[3] = ph[2];
ph[2] = ph[1];
ph[1] = ph[0];
ph[0] = value;
SerialState->sliderSerialResponse.scanMode = 1;
SerialState->sliderSerialResponse.scanCount = 1;
SerialState->sliderResponseCnt = 1;
}
void TouchSliderState::ResetSensors()
{
for (int i = 0; i < SLIDER_SENSORS; i++)
SetSensor(i, NO_PRESSURE);
}
}