mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-25 07:21:14 +01:00
InputCommon: Add Pipes InputBackend class.
This commit is contained in:
parent
8098be3dfa
commit
2ac59bf581
@ -77,7 +77,7 @@ void ControllerInterface::Initialize(const WindowSystemInfo& wsi)
|
|||||||
m_input_backends.emplace_back(ciface::evdev::CreateInputBackend(this));
|
m_input_backends.emplace_back(ciface::evdev::CreateInputBackend(this));
|
||||||
#endif
|
#endif
|
||||||
#ifdef CIFACE_USE_PIPES
|
#ifdef CIFACE_USE_PIPES
|
||||||
// nothing needed
|
m_input_backends.emplace_back(ciface::Pipes::CreateInputBackend(this));
|
||||||
#endif
|
#endif
|
||||||
#ifdef CIFACE_USE_DUALSHOCKUDPCLIENT
|
#ifdef CIFACE_USE_DUALSHOCKUDPCLIENT
|
||||||
m_input_backends.emplace_back(ciface::DualShockUDPClient::CreateInputBackend(this));
|
m_input_backends.emplace_back(ciface::DualShockUDPClient::CreateInputBackend(this));
|
||||||
@ -165,9 +165,6 @@ void ControllerInterface::RefreshDevices(RefreshReason reason)
|
|||||||
#ifdef CIFACE_USE_ANDROID
|
#ifdef CIFACE_USE_ANDROID
|
||||||
ciface::Android::PopulateDevices();
|
ciface::Android::PopulateDevices();
|
||||||
#endif
|
#endif
|
||||||
#ifdef CIFACE_USE_PIPES
|
|
||||||
ciface::Pipes::PopulateDevices();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for (auto& backend : m_input_backends)
|
for (auto& backend : m_input_backends)
|
||||||
backend->PopulateDevices();
|
backend->PopulateDevices();
|
||||||
|
@ -39,7 +39,19 @@ static double StringToDouble(const std::string& text)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PopulateDevices()
|
class InputBackend final : public ciface::InputBackend
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
using ciface::InputBackend::InputBackend;
|
||||||
|
void PopulateDevices() override;
|
||||||
|
};
|
||||||
|
|
||||||
|
std::unique_ptr<ciface::InputBackend> CreateInputBackend(ControllerInterface* controller_interface)
|
||||||
|
{
|
||||||
|
return std::make_unique<InputBackend>(controller_interface);
|
||||||
|
}
|
||||||
|
|
||||||
|
void InputBackend::PopulateDevices()
|
||||||
{
|
{
|
||||||
// Search the Pipes directory for files that we can open in read-only,
|
// Search the Pipes directory for files that we can open in read-only,
|
||||||
// non-blocking mode. The device name is the virtual name of the file.
|
// non-blocking mode. The device name is the virtual name of the file.
|
||||||
|
@ -21,7 +21,7 @@ namespace ciface::Pipes
|
|||||||
// SET {L, R} [0, 1]
|
// SET {L, R} [0, 1]
|
||||||
// SET {MAIN, C} [0, 1] [0, 1]
|
// SET {MAIN, C} [0, 1] [0, 1]
|
||||||
|
|
||||||
void PopulateDevices();
|
std::unique_ptr<ciface::InputBackend> CreateInputBackend(ControllerInterface* controller_interface);
|
||||||
|
|
||||||
class PipeDevice : public Core::Device
|
class PipeDevice : public Core::Device
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user