adding bindings

This commit is contained in:
Kbz-8
2025-03-13 16:58:10 +01:00
parent 8c27a1eb20
commit 96bb8c94f5
3 changed files with 29 additions and 1 deletions

View File

@@ -224,6 +224,11 @@ namespace mlx
return y;
}
void SDLManager::SetInputBinding(std::function<void(SDL_Event*)> functor)
{
m_binding_hook = std::move(functor);
}
void SDLManager::InputsFetcher(std::function<void(mlx_event_type, int, int)> functor)
{
SDL_Event event;
@@ -269,6 +274,8 @@ namespace mlx
default: break;
}
m_binding_hook(&event);
}
}