KeyboardController (component)#

This component is the base class for custom classes that handle keyboard inputs. It currently allows for the assignment of six keys (up, down, left, right, attack A and attack B), which can have actions for when the button is pressed and for when the button is released. KeyboardController.hpp also defines the KeyBind for the different possible keys (as well as keys for camera toggle, resetting and quitting), and the global_key_bind_map which is set up in Game.cpp.

Contents:

Typedefs

using vec = Eigen::Vector2f#

Enums

enum class KeyBind : std::size_t#

Values:

enumerator UP#
enumerator DOWN#
enumerator LEFT#
enumerator RIGHT#
enumerator ATTACK_A#
enumerator ATTACK_B#
enumerator CAMERA_TOGGLE#
enumerator RESET#
enumerator QUIT#

Variables

std::map<int, KeyBind> global_key_bind_map#

A map between the key_bind enum and the SDL_KeyCode.

struct KeyboardController : public Component#

Subclassed by KeyboardPlayer

Public Functions

inline KeyboardController()#
inline virtual void init() override#
virtual void update() override#

Defined in KeyboardController.cpp file.

inline virtual void on_up()#
inline virtual void on_down()#
inline virtual void on_left()#
inline virtual void on_right()#
inline virtual void on_attack_a()#
inline virtual void on_attack_b()#
inline virtual void on_up_end()#
inline virtual void on_down_end()#
inline virtual void on_left_end()#
inline virtual void on_right_end()#
inline virtual void on_attack_a_end()#
inline virtual void on_attack_b_end()#
inline virtual void on_update_end()#

Public Members

std::map<int, KeyBind> local_key_bind_map#

A map between the key_bind enum and the SDL_KeyCode.