InputCommon: Add Quartz InputBackend class.

This commit is contained in:
Jordan Woyak
2024-03-11 01:31:30 -05:00
parent 9941c54911
commit 498584ac77
4 changed files with 21 additions and 18 deletions

View File

@ -7,15 +7,25 @@
namespace ciface::Quartz
{
void PopulateDevices(void* window)
class InputBackend final : public ciface::InputBackend
{
if (!window)
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()
{
const WindowSystemInfo wsi = GetControllerInterface().GetWindowSystemInfo();
if (wsi.type != WindowSystemType::MacOS)
return;
g_controller_interface.AddDevice(std::make_shared<KeyboardAndMouse>(window));
GetControllerInterface().AddDevice(std::make_shared<KeyboardAndMouse>(wsi.render_window));
}
void DeInit()
{
}
} // namespace ciface::Quartz