XInput Rumble

This commit is contained in:
nastys
2019-09-11 02:25:01 +02:00
parent b2d5311d79
commit 8d02025254
5 changed files with 21 additions and 6 deletions
@@ -19,8 +19,11 @@ namespace TLAC::Components
{
const std::string KEY_CONFIG_FILE_NAME = "keyconfig.ini";
TouchSliderEmulator* TouchSliderEmulator::LatestInstance;
TouchSliderEmulator::TouchSliderEmulator()
{
LatestInstance = this;
}
TouchSliderEmulator::~TouchSliderEmulator()
@@ -17,6 +17,8 @@ namespace TLAC::Components
class TouchSliderEmulator : public EmulatorComponent
{
public:
static TouchSliderEmulator* LatestInstance;
Input::Binding* LeftSideSlideLeft;
Input::Binding* LeftSideSlideRight;
@@ -34,6 +36,14 @@ namespace TLAC::Components
virtual void OnFocusLost() override;
bool isSliderTouched()
{
for (int i = 0; i < 32; i++)
if (sliderState->SensorTouched[i].IsTouched) return true;
return false;
}
private:
ComponentsManager* componentsManager;
float sliderSpeed = 750.0f;