66 void onKeypress(std::function<
void()> callback,
bool overwrite =
true);
75 void onKeypress(std::function<
void(
const std::optional<sf::Event>&)> callback,
bool overwrite =
true);
86 void onKeyRelease(std::function<
void()> callback,
bool overwrite =
true);
95 void onKeyRelease(std::function<
void(
const std::optional<sf::Event>&)> callback,
bool overwrite =
true);
119 void onTextEntered(std::function<
void(
const std::optional<sf::Event>&)> callback,
bool overwrite =
true);
132 bool occurred(
const std::optional<sf::Event>& event)
override;
133 bool filter(
const std::optional<sf::Event>& event,
Core* component)
override;
134 void fire(
const std::optional<sf::Event>& event)
override;
#define ML_EXPORT(ClassName)
Register a Malena type with the framework.
Virtual base class for all Malena framework objects.
Base class for all per-event dispatchers in the Malena event system.
Base class for all event-receiving traits.
Trait that adds keyboard-input callbacks to any Core object.
void onKeypress(std::function< void(const std::optional< sf::Event > &)> callback, bool overwrite=true)
Register a callback invoked when a key is pressed while this component has focus, receiving the raw S...
void onKeypress(std::function< void()> callback, bool overwrite=true)
Register a no-argument callback invoked when a key is pressed while this component has focus.
void onKeyRelease(std::function< void()> callback, bool overwrite=true)
Register a no-argument callback invoked when a key is released while this component has focus.
void onKeyRelease(std::function< void(const std::optional< sf::Event > &)> callback, bool overwrite=true)
Register a callback invoked when a key is released while this component has focus,...
void onTextEntered(std::function< void()> callback, bool overwrite=true)
Register a no-argument callback invoked when a unicode character is entered while this component has ...
void onTextEntered(std::function< void(const std::optional< sf::Event > &)> callback, bool overwrite=true)
Register a callback invoked when a unicode character is entered while this component has focus,...