Allow to return up to 16 touch inputs per engine
This commit is contained in:
parent
390ee10eef
commit
d8df9a16bd
10 changed files with 203 additions and 155 deletions
|
@ -78,8 +78,8 @@ public:
|
|||
explicit UDPTouch(std::string ip_, u16 port_, u16 pad_, CemuhookUDP::Client* client_)
|
||||
: ip(std::move(ip_)), port(port_), pad(pad_), client(client_) {}
|
||||
|
||||
std::tuple<float, float, bool> GetStatus() const override {
|
||||
return client->GetPadState(ip, port, pad).touch_status;
|
||||
Input::TouchStatus GetStatus() const override {
|
||||
return client->GetTouchState();
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -107,32 +107,4 @@ std::unique_ptr<Input::TouchDevice> UDPTouchFactory::Create(const Common::ParamP
|
|||
return std::make_unique<UDPTouch>(std::move(ip), port, pad, client.get());
|
||||
}
|
||||
|
||||
void UDPTouchFactory::BeginConfiguration() {
|
||||
polling = true;
|
||||
client->BeginConfiguration();
|
||||
}
|
||||
|
||||
void UDPTouchFactory::EndConfiguration() {
|
||||
polling = false;
|
||||
client->EndConfiguration();
|
||||
}
|
||||
|
||||
Common::ParamPackage UDPTouchFactory::GetNextInput() {
|
||||
Common::ParamPackage params;
|
||||
CemuhookUDP::UDPPadStatus pad;
|
||||
auto& queue = client->GetPadQueue();
|
||||
while (queue.Pop(pad)) {
|
||||
if (pad.touch == CemuhookUDP::PadTouch::Undefined) {
|
||||
continue;
|
||||
}
|
||||
params.Set("engine", "cemuhookudp");
|
||||
params.Set("ip", pad.host);
|
||||
params.Set("port", static_cast<u16>(pad.port));
|
||||
params.Set("pad_index", static_cast<u16>(pad.pad_index));
|
||||
params.Set("touch", static_cast<u16>(pad.touch));
|
||||
return params;
|
||||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
} // namespace InputCommon
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue