Input: UDP Client to provide motion and touch controls

An implementation of the cemuhook motion/touch protocol, this adds the
ability for users to connect several different devices to citra to send
direct motion and touch data to citra.
This commit is contained in:
James Rowe 2018-01-18 08:43:17 -07:00
parent 1e724b046b
commit 6bcbda5ab2
16 changed files with 758 additions and 14 deletions

View file

@ -414,18 +414,16 @@ private:
SDL_JoystickID analog_axes_joystick = -1;
};
std::vector<std::unique_ptr<InputCommon::Polling::DevicePoller>> GetPollers(
InputCommon::Polling::DeviceType type) {
std::vector<std::unique_ptr<InputCommon::Polling::DevicePoller>> pollers;
void GetPollers(InputCommon::Polling::DeviceType type,
std::vector<std::unique_ptr<InputCommon::Polling::DevicePoller>>& pollers) {
switch (type) {
case InputCommon::Polling::DeviceType::Analog:
pollers.push_back(std::make_unique<SDLAnalogPoller>());
pollers.emplace_back(std::make_unique<SDLAnalogPoller>());
break;
case InputCommon::Polling::DeviceType::Button:
pollers.push_back(std::make_unique<SDLButtonPoller>());
pollers.emplace_back(std::make_unique<SDLButtonPoller>());
break;
}
return pollers;
}
} // namespace Polling
} // namespace SDL

View file

@ -34,8 +34,8 @@ Common::ParamPackage SDLEventToButtonParamPackage(const SDL_Event& event);
namespace Polling {
/// Get all DevicePoller that use the SDL backend for a specific device type
std::vector<std::unique_ptr<InputCommon::Polling::DevicePoller>> GetPollers(
InputCommon::Polling::DeviceType type);
void GetPollers(InputCommon::Polling::DeviceType type,
std::vector<std::unique_ptr<InputCommon::Polling::DevicePoller>>& pollers);
} // namespace Polling
} // namespace SDL