2019-10-31 18:00:42 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "switch.h"
|
|
|
|
#include "IController.h"
|
|
|
|
#include "SwitchVirtualGamepadHandler.h"
|
|
|
|
|
|
|
|
//Wrapper for AbstractedPad for switch versions [5.0.0 - 8.1.0]
|
|
|
|
class SwitchAbstractedPadHandler : public SwitchVirtualGamepadHandler
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
s8 m_abstractedPadID;
|
|
|
|
HiddbgAbstractedPadState m_state;
|
|
|
|
|
|
|
|
public:
|
|
|
|
//Initialize the class with specified controller
|
|
|
|
SwitchAbstractedPadHandler(std::unique_ptr<IController> &&controller);
|
|
|
|
~SwitchAbstractedPadHandler();
|
|
|
|
|
|
|
|
//Initialize controller handler, AbstractedPadState
|
2019-11-13 11:27:43 +00:00
|
|
|
virtual Result Initialize() override;
|
|
|
|
virtual void Exit() override;
|
2019-10-31 18:00:42 +00:00
|
|
|
|
|
|
|
//This will be called periodically by the input threads
|
2019-11-13 11:27:43 +00:00
|
|
|
virtual void UpdateInput() override;
|
2019-10-31 18:00:42 +00:00
|
|
|
//This will be called periodically by the output threads
|
2019-11-13 11:27:43 +00:00
|
|
|
virtual void UpdateOutput() override;
|
2019-10-31 18:00:42 +00:00
|
|
|
|
|
|
|
//Separately init and close the HDL state
|
|
|
|
Result InitAbstractedPadState();
|
|
|
|
Result ExitAbstractedPadState();
|
|
|
|
|
|
|
|
void FillAbstractedState(const NormalizedButtonData &data);
|
|
|
|
Result UpdateAbstractedState();
|
|
|
|
};
|