antara::gaming::event¶
antara::gaming::event::key_pressed¶
-
struct
key_pressed
¶ triggered when pressing a key on the keyboard.
Note
This class is automatically reflected for scripting systems such as lua, python.
Public Functions
-
key_pressed
(input::key key_, bool alt_, bool control_, bool shift_, bool system_)¶ Constructors.
constructor with args
Note
Principal Constructor.
- Parameters
key_
: represents the keyboard key currently pressedalt_
: is true if the alt key on the keyboard is pressedcontrol_
: is true if the keyboard control key is pressedshift_
: is true if the keyboard shift_ key is pressedsystem_
: is true if the keyboard system key is pressed
Example:
#include <entt/entity/registry.hpp> #include <entt/dispatcher/dispatcher.hpp> #include <antara/gaming/event/key.pressed.hpp> int main() { entt::registry entity_registry; entt::dispatcher& dispatcher{registry.set<entt::dispatcher>()}; dispatcher.trigger<key_pressed>(input::key::a, false, false, false, false); }
-
key_pressed
()¶ default constructor (for scripting systems convenience)
-
antara::gaming::event::key_released¶
-
struct
key_released
¶ triggered when releasing a key on the keyboard.
Note
This class is automatically reflected for scripting systems such as lua, python.
Public Functions
-
key_released
(input::key key_, bool alt_, bool control_, bool shift_, bool system_)¶ Constructors.
constructor with args
Note
Principal Constructor.
- Parameters
key_
: represents the keyboard key currently releasedalt_
: is true if the alt key on the keyboard is releasedcontrol_
: is true if the keyboard control key is releasedshift_
: is true if the keyboard shift_ key is releasedsystem_
: is true if the keyboard system key is released
Example:
#include <entt/entity/registry.hpp> #include <entt/dispatcher/dispatcher.hpp> #include <antara/gaming/event/key_released.hpp> int main() { entt::registry entity_registry; entt::dispatcher& dispatcher{registry.set<entt::dispatcher>()}; dispatcher.trigger<key_released>(input::key::a, false, false, false, false); }
-
key_released
()¶ default constructor (for scripting systems convenience)
-
antara::gaming::event::quit_game¶
-
struct
quit_game
¶ Event that allows us to leave a game with a return value.
Note
This class is automatically reflected for scripting systems such as lua, python.
Public Functions
-
quit_game
(int return_value)¶ Constructors.
constructor with args
Note
Principal Constructor.
- Parameters
return_value
: The return value of the program when leaving the game
Example:
#include <entt/entity/registry.hpp> #include <entt/dispatcher/dispatcher.hpp> #include <antara/gaming/event/quit_game.hpp> int main() { entt::registry entity_registry; entt::dispatcher& dispatcher{registry.set<entt::dispatcher>()}; dispatcher.trigger<quit_game>(0); }
-
quit_game
()¶ default constructor (for scripting systems convenience)
Public Members
-
int
return_value_
¶ Fields.
the return value of the program when leaving the game
-