SleakEngine 1.0.0
C++23 multi-backend game engine
Loading...
Searching...
No Matches
InputAction.hpp
Go to the documentation of this file.
1#ifndef _INPUTACTION_HPP_
2#define _INPUTACTION_HPP_
3
4#include <vector>
5#include <string>
7
8namespace Sleak {
9 namespace Input {
10 /// A named input binding across keys, mouse buttons, and gamepad
11 /// buttons/axes, queried as a single logical action.
12 /// @ingroup input
14 public:
15 std::string name;
16 std::vector<int> keyMappings;
17 std::vector<int> mouseButtonMappings;
18 std::vector<int> gamepadButtonMappings;
19 std::vector<std::pair<int, float>> gamepadAxisMappings;
20
21 InputAction(const std::string& name) : name(name) {}
22
23 /// True if any bound key, button, or axis is currently active in inputManager.
24 bool isPressed(const InputManager& inputManager) const;
25 };
26 }
27}
28
29#endif
std::vector< std::pair< int, float > > gamepadAxisMappings
std::vector< int > keyMappings
std::vector< int > mouseButtonMappings
std::vector< int > gamepadButtonMappings
bool isPressed(const InputManager &inputManager) const
True if any bound key, button, or axis is currently active in inputManager.
InputAction(const std::string &name)
Key and mouse-button code enumerations plus their name lookups.
Root namespace for everything the engine exposes.
Definition Camera.hpp:10