service: hid: Implement GetLastActiveNpad
This commit is contained in:
parent
3516a2d0bf
commit
5105b90017
|
@ -275,11 +275,14 @@ void IHidSystemServer::DisableAssigningSingleOnSlSrPress(HLERequestContext& ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
void IHidSystemServer::GetLastActiveNpad(HLERequestContext& ctx) {
|
void IHidSystemServer::GetLastActiveNpad(HLERequestContext& ctx) {
|
||||||
LOG_DEBUG(Service_HID, "(STUBBED) called"); // Spams a lot when controller applet is running
|
Core::HID::NpadIdType npad_id{};
|
||||||
|
const Result result = GetResourceManager()->GetNpad()->GetLastActiveNpad(npad_id);
|
||||||
|
|
||||||
|
LOG_DEBUG(Service_HID, "called, npad_id={}", npad_id);
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 3};
|
IPC::ResponseBuilder rb{ctx, 3};
|
||||||
rb.Push(ResultSuccess);
|
rb.Push(result);
|
||||||
rb.Push(0); // Dont forget to fix this
|
rb.PushEnum(npad_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IHidSystemServer::ApplyNpadSystemCommonPolicyFull(HLERequestContext& ctx) {
|
void IHidSystemServer::ApplyNpadSystemCommonPolicyFull(HLERequestContext& ctx) {
|
||||||
|
|
|
@ -1378,4 +1378,10 @@ Result NPad::AssigningSingleOnSlSrPress(u64 aruid, bool is_enabled) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result NPad::GetLastActiveNpad(Core::HID::NpadIdType& out_npad_id) const {
|
||||||
|
std::scoped_lock lock{mutex};
|
||||||
|
out_npad_id = hid_core.GetLastActiveController();
|
||||||
|
return ResultSuccess;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Service::HID
|
} // namespace Service::HID
|
||||||
|
|
|
@ -159,6 +159,8 @@ public:
|
||||||
|
|
||||||
Result AssigningSingleOnSlSrPress(u64 aruid, bool is_enabled);
|
Result AssigningSingleOnSlSrPress(u64 aruid, bool is_enabled);
|
||||||
|
|
||||||
|
Result GetLastActiveNpad(Core::HID::NpadIdType& out_npad_id) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct VibrationData {
|
struct VibrationData {
|
||||||
bool device_mounted{};
|
bool device_mounted{};
|
||||||
|
|
Loading…
Reference in a new issue