Potato Engine
Loading...
Searching...
No Matches
InputBinding Struct Reference

Wrapper for input bindings. More...

#include <InputBinding.hpp>

Public Member Functions

template<typename T>
 InputBinding (Keycode key, InputType type, std::string name, T *obj, void(T::*callback)())
 Constructs binding with method callback.
 InputBinding (Keycode key, InputType type, std::string name, void(*callback)())
 Constructs binding with standalone callback.
const EventDelegateGetDelegate () const
 Gets EventDelegate reference.

Public Attributes

std::string name
Keycode key
InputType type

Detailed Description

Wrapper for input bindings.

Definition at line 10 of file InputBinding.hpp.

Constructor & Destructor Documentation

◆ InputBinding() [1/2]

template<typename T>
InputBinding::InputBinding ( Keycode key,
InputType type,
std::string name,
T * obj,
void(T::* callback )() )
inline

Constructs binding with method callback.

  • Template Parameters
    T
    Parameters
    keyKeycode to bind to
    typeInputType to bind to
    nameIdentifier for binding
    objObject to bind to
    callbackFunction to notify

Definition at line 33 of file InputBinding.hpp.

◆ InputBinding() [2/2]

InputBinding::InputBinding ( Keycode key,
InputType type,
std::string name,
void(* callback )() )
inline

Constructs binding with standalone callback.

Parameters
keyKeycode to bind to
typeInputType to bind to
nameIdentifier for binding
callbackFunction to notify

Definition at line 47 of file InputBinding.hpp.

Member Function Documentation

◆ GetDelegate()

const EventDelegate & InputBinding::GetDelegate ( ) const
inline

Gets EventDelegate reference.

Returns
Delegate

Definition at line 55 of file InputBinding.hpp.

Member Data Documentation

◆ name

std::string InputBinding::name

Definition at line 14 of file InputBinding.hpp.

◆ key

Keycode InputBinding::key

Definition at line 20 of file InputBinding.hpp.

◆ type

InputType InputBinding::type

Definition at line 21 of file InputBinding.hpp.