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>
6
#include <
Input/InputManager.hpp
>
7
8
namespace
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
13
class
InputAction
{
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
InputManager.hpp
Sleak::Input::InputAction::gamepadAxisMappings
std::vector< std::pair< int, float > > gamepadAxisMappings
Definition
InputAction.hpp:19
Sleak::Input::InputAction::keyMappings
std::vector< int > keyMappings
Definition
InputAction.hpp:16
Sleak::Input::InputAction::mouseButtonMappings
std::vector< int > mouseButtonMappings
Definition
InputAction.hpp:17
Sleak::Input::InputAction::name
std::string name
Definition
InputAction.hpp:15
Sleak::Input::InputAction::gamepadButtonMappings
std::vector< int > gamepadButtonMappings
Definition
InputAction.hpp:18
Sleak::Input::InputAction::isPressed
bool isPressed(const InputManager &inputManager) const
True if any bound key, button, or axis is currently active in inputManager.
Sleak::Input::InputAction::InputAction
InputAction(const std::string &name)
Definition
InputAction.hpp:21
Sleak::Input::InputManager
Definition
InputManager.hpp:11
Sleak::Input
Key and mouse-button code enumerations plus their name lookups.
Definition
InputAction.hpp:9
Sleak
Root namespace for everything the engine exposes.
Definition
Camera.hpp:10
include
public
Input
InputAction.hpp
Generated on
for SleakEngine by
1.16.1