| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
The input plugin is responsible for handling user input events such as keyboard and mouse actions. It provides a unified interface for managing input across different platforms and devices.
There are currently two ways of interacting with user input in the engine:
Polling methods are provided under the ES::Plugin::Input::Utils namespace. The following methods are available:
Event-based input handling is available for keyboard and mouse events. The developer can add event callbacks using the InputManager resource.
The InputManager resource is automatically added to the core when the Input plugin is bound, like so:
#include "Input.hpp"
void main() {
// Create the engine
auto core = ES::Engine::Core();
// Bind the Input plugin
core.AddPlugins<ES::Plugin::Input::Plugin>();
}It is then possible to get a reference to the InputManager resource using the GetResource method:
#include "Input.hpp"
void TestSystem(ES::Engine::Core &core) {
// Get the InputManager resource
auto &inputManager = core.GetResource<ES::Plugin::Input::InputManager>();
}The InputManager resource provides the following methods for adding event callbacks:
The public Call(...something) methods to call all the callbacks are public but should not be called directly. They are used internally to be able to be bound with glfw callbacks, which is the reason they are public.
©2024-2026 - EngineSquared - All rights reserved - v0.2.0
| Back | FazBrowse Home | New Git URL |