Component that lets entities receive input events.
- Reflectible
- Not serializable as it contains functors
- Processed by the InputSystem
putils::function<void(Entity::ID window, int keycode, bool pressed), KENGINE_INPUT_FUNCTION_SIZE> onKey;putils::function<void(Entity::ID window, const putils::Point2f & screenCoordinates, const putils::Point2f & relativeMovement), KENGINE_INPUT_FUNCTION_SIZE> onMouseMove;putils::function<void(Entity::ID window, int button, const putils::Point2f & screenCoordinates, bool pressed), KENGINE_INPUT_FUNCTION_SIZE> onMouseButton;putils::function<void(Entity::ID window, float xoffset, float yoffset, const putils::Point2f & screenCoordinates), KENGINE_INPUT_FUNCTION_SIZE)> onMouseWheel;All these callbacks take as a first parameter the id of the window entity in which the event happened.
The maximum size for these functors defaults to 64 and can be adjusted by defining the KENGINE_INPUT_FUNCTION_SIZE macro.