Potato Engine
Toggle main menu visibility
Loading...
Searching...
No Matches
InputBinding.hpp
Go to the documentation of this file.
1
2
#pragma once
3
4
#include "
Core/Event/EventController.hpp
"
5
#include "
Input.hpp
"
6
10
struct
InputBinding
11
{
12
// optimized declaration order
13
public
:
14
std::string name;
15
16
private
:
17
EventDelegate<>
delegate;
18
19
public
:
20
Keycode
key;
21
InputType
type;
22
32
template
<
typename
T>
33
InputBinding
(
Keycode
key,
InputType
type, std::string name, T* obj,
void
(T::*callback)()) :
34
name(name),
35
delegate(obj, callback),
36
key(key),
37
type(type)
38
{}
39
47
InputBinding
(
Keycode
key,
InputType
type, std::string name,
void
(*callback)()) :
48
name(name),
49
delegate(callback),
50
key(key),
51
type(type)
52
{}
53
55
inline
const
EventDelegate<>
&
GetDelegate
()
const
{
return
delegate; }
56
57
};
EventController.hpp
Input.hpp
Global input enum definitions.
InputType
InputType
Enum representing input states.
Definition
Input.hpp:52
Keycode
Keycode
Enum representing input keys.
Definition
Input.hpp:15
EventDelegate
A wrapper that carries response delegate information.
Definition
EventDelegate.hpp:13
InputBinding::GetDelegate
const EventDelegate & GetDelegate() const
Gets EventDelegate reference.
Definition
InputBinding.hpp:55
InputBinding::InputBinding
InputBinding(Keycode key, InputType type, std::string name, T *obj, void(T::*callback)())
Constructs binding with method callback.
Definition
InputBinding.hpp:33
InputBinding::InputBinding
InputBinding(Keycode key, InputType type, std::string name, void(*callback)())
Constructs binding with standalone callback.
Definition
InputBinding.hpp:47
Core
Input
InputBinding.hpp
Generated by
1.17.0