1#ifndef LIBSBX_DEVICES_INPUT_HPP_
2#define LIBSBX_DEVICES_INPUT_HPP_
5#include <unordered_map>
9#include <libsbx/utility/bitmask.hpp>
11#include <libsbx/math/vector2.hpp>
13#include <libsbx/devices/key.hpp>
14#include <libsbx/devices/mouse_button.hpp>
15#include <libsbx/devices/input_action.hpp>
16#include <libsbx/devices/input_mod.hpp>
18namespace sbx::devices {
22 input_action last_action;
34 static auto is_key_pressed(key key) -> bool;
36 static auto is_key_down(key key) -> bool;
38 static auto is_key_released(key key) -> bool;
40 static auto is_mouse_button_pressed(mouse_button button) -> bool;
42 static auto is_mouse_button_down(mouse_button button) -> bool;
44 static auto is_mouse_button_released(mouse_button button) -> bool;
52 static auto _transition_pressed_keys() -> void;
54 static auto _transition_pressed_mouse_buttons() -> void;
56 static auto _transition_scroll_delta() -> void;
58 static auto _update_key_state(key key, input_action action) -> void;
60 static auto _update_mouse_button_state(mouse_button button, input_action action) -> void;
62 static auto _update_mouse_position(
const math::vector2& position) -> void;
64 static auto _update_scroll_delta(
const math::vector2& delta) -> void;
66 static std::unordered_map<key, key_state> _key_states;
67 static std::unordered_map<mouse_button, key_state> _mouse_button_states;
Definition: devices_module.hpp:25
Definition: window.hpp:30
A vector in two-dimensional space.
Definition: vector2.hpp:27