An event dispatcher for input events.
More...
#include <event_bus.h>
|
| void | emit (key key, action action) |
| | Informs all subscribers of a new keyboard event.
|
| |
| void | emit (mouse mouse, action action) |
| | Informs all subscribers of a new mouse button event.
|
| |
| void | emit (const Eigen::Vector2f &cursor_pos) |
| | Informs all subscribers of a new cursor movement event.
|
| |
| void | subscribe (std::function< void(key, action)> func) |
| | Attaches a subscriber to new keyboard events.
|
| |
| void | subscribe (std::function< void(mouse, action)> func) |
| | Attaches a subscriber to new mouse button events.
|
| |
| void | subscribe (std::function< void(Eigen::Vector2f)> func) |
| | Attaches a subscriber to new cursor movement events.
|
| |
An event dispatcher for input events.
◆ emit() [1/3]
| void engine::input::event_bus::emit |
( |
const Eigen::Vector2f & |
cursor_pos | ) |
|
|
inline |
Informs all subscribers of a new cursor movement event.
- Parameters
-
| cursor_pos | The new cursor position. |
◆ emit() [2/3]
| void engine::input::event_bus::emit |
( |
key |
key, |
|
|
action |
action |
|
) |
| |
|
inline |
Informs all subscribers of a new keyboard event.
- Parameters
-
| key | The key whose status is changed. |
| action | The specific action that is performed. |
◆ emit() [3/3]
| void engine::input::event_bus::emit |
( |
mouse |
mouse, |
|
|
action |
action |
|
) |
| |
|
inline |
Informs all subscribers of a new mouse button event.
- Parameters
-
| mouse | The mouse button whose status is changed. |
| action | The specific action that is performed. |
◆ subscribe() [1/3]
| void engine::input::event_bus::subscribe |
( |
std::function< void(Eigen::Vector2f)> |
func | ) |
|
|
inline |
Attaches a subscriber to new cursor movement events.
- Parameters
-
| func | A function to be called when an event is emitted. |
◆ subscribe() [2/3]
| void engine::input::event_bus::subscribe |
( |
std::function< void(key, action)> |
func | ) |
|
|
inline |
Attaches a subscriber to new keyboard events.
- Parameters
-
| func | A function to be called when an event is emitted. |
◆ subscribe() [3/3]
| void engine::input::event_bus::subscribe |
( |
std::function< void(mouse, action)> |
func | ) |
|
|
inline |
Attaches a subscriber to new mouse button events.
- Parameters
-
| func | A function to be called when an event is emitted. |
The documentation for this class was generated from the following file:
- /home/runner/work/deep-learning-visualizer/deep-learning-visualizer/src/engine/input/event_bus.h