7#include <SFML/Window/Keyboard.hpp>
8#include <SFML/Window/Event.hpp>
22 const sf::Keyboard::Key
up,
23 const sf::Keyboard::Key
right,
24 const sf::Keyboard::Key
down,
25 const sf::Keyboard::Key
left,
35 const sf::Keyboard::Key k
55 std::vector<sf::Keyboard::Key> m_actions;
56 sf::Keyboard::Key m_down;
57 sf::Keyboard::Key m_left;
58 sf::Keyboard::Key m_right;
59 sf::Keyboard::Key m_up;
79std::ostream& operator<<(std::ostream& os, const
key_bindings& keys) noexcept;
The number of an action.
Definition action_number.h:12
The key bindings.
Definition key_bindings.h:19
sf::Keyboard::Key get_key_for_move_up() const noexcept
Get the key for moving up.
Definition key_bindings.h:51
std::vector< user_input_type > create_actions(const sf::Keyboard::Key k) const noexcept
From an event, create zero or one user inputs.
Definition key_bindings.cpp:27
sf::Keyboard::Key get_key_for_move_right() const noexcept
Get the key for moving right.
Definition key_bindings.h:48
sf::Keyboard::Key get_key_for_action(const action_number &action) const
Get the key for action 1, 2, 3 or 4.
Definition key_bindings.cpp:95
sf::Keyboard::Key get_key_for_move_left() const noexcept
Get the key for moving left.
Definition key_bindings.h:45
sf::Keyboard::Key get_key_for_move_down() const noexcept
Get the key for moving down.
Definition key_bindings.h:42
void test_key_bindings()
Test this class and its free functions.
Definition key_bindings.cpp:108
key_bindings create_left_keyboard_key_bindings() noexcept
Create the key bindings for a player at the left side of a keyboard.
Definition key_bindings.cpp:67
key_bindings create_right_keyboard_key_bindings() noexcept
Create the key bindings for a player at the right side of a keyboard.
Definition key_bindings.cpp:81
sf::Keyboard::Key get_key_for_action(const key_bindings &k, const action_number &action) noexcept
Get the key for a specific action.
Definition key_bindings.cpp:103