2#ifndef LIBSBX_DEVICES_INPUT_HPP_
3#define LIBSBX_DEVICES_INPUT_HPP_
6#include <unordered_map>
10#include <libsbx/utility/bitmask.hpp>
12#include <libsbx/math/vector2.hpp>
14#include <libsbx/devices/key.hpp>
15#include <libsbx/devices/mouse_button.hpp>
16#include <libsbx/devices/input_action.hpp>
17#include <libsbx/devices/input_mod.hpp>
19namespace sbx::devices {
23 input_action last_action;
35 static auto is_key_pressed(key key) -> bool;
36 static auto is_key_down(key key) -> bool;
37 static auto is_key_released(key key) -> bool;
39 static auto is_mouse_button_pressed(mouse_button button) -> bool;
40 static auto is_mouse_button_down(mouse_button button) -> bool;
41 static auto is_mouse_button_released(mouse_button button) -> bool;
55 static auto set_scene_input_active(
bool active) -> void;
57 static auto is_scene_input_active() -> bool;
61 static auto _transition_pressed_keys() -> void;
62 static auto _transition_pressed_mouse_buttons() -> void;
63 static auto _transition_scroll_delta() -> void;
65 static auto _update_key_state(key key, input_action action) -> void;
66 static auto _update_mouse_button_state(mouse_button button, input_action action) -> void;
67 static auto _update_mouse_position(
const math::vector2& position) -> void;
68 static auto _update_scroll_delta(
const math::vector2& delta) -> void;
70 static std::unordered_map<key, key_state> _key_states;
71 static std::unordered_map<mouse_button, key_state> _mouse_button_states;
79 static bool _is_active;
80 static bool _is_captured;
Definition: devices_module.hpp:27
Definition: window.hpp:33
A vector in two-dimensional space.
Definition: vector2.hpp:28