File tree 4 files changed +10
-14
lines changed
4 files changed +10
-14
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ namespace Fluffy
51
51
return m_ReleasedButtons & button;
52
52
}
53
53
54
- bool Controller::IsPrevious (unsigned int button)
54
+ bool Controller::IsHeld (unsigned int button)
55
55
{
56
56
return m_PreviousButtons & button;
57
57
}
@@ -62,9 +62,9 @@ namespace Fluffy
62
62
{
63
63
switch (binding.first .inputState )
64
64
{
65
- case InputState::Previous :
65
+ case InputState::Held :
66
66
{
67
- if (IsPrevious (unsigned int (binding.first .button )))
67
+ if (IsHeld (unsigned int (binding.first .button )))
68
68
{
69
69
binding.second ->Execute ();
70
70
}
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ namespace Fluffy
63
63
64
64
bool IsPressed (unsigned int button) override ;
65
65
bool IsReleased (unsigned int button) override ;
66
- bool IsPrevious (unsigned int button) override ;
66
+ bool IsHeld (unsigned int button) override ;
67
67
68
68
void HandleInput () override ;
69
69
Original file line number Diff line number Diff line change 2
2
#include " Command.h"
3
3
#include < functional>
4
4
#include < algorithm>
5
+ #include < iostream>
5
6
6
7
namespace Fluffy
7
8
{
@@ -39,7 +40,7 @@ namespace Fluffy
39
40
return m_ReleasedKeys[key];
40
41
}
41
42
42
- bool Keyboard::IsPrevious (unsigned int key)
43
+ bool Keyboard::IsHeld (unsigned int key)
43
44
{
44
45
return m_PreviousKeys[key];
45
46
}
@@ -50,30 +51,25 @@ namespace Fluffy
50
51
{
51
52
switch (binding.first .inputState )
52
53
{
53
- case InputState::Previous :
54
+ case InputState::Held :
54
55
{
55
- if (IsPrevious (binding.first .key ))
56
- {
56
+ if (IsHeld (binding.first .key ))
57
57
binding.second ->Execute ();
58
- }
59
58
60
59
break ;
61
60
}
62
61
case InputState::Pressed:
63
62
{
64
63
if (IsPressed (binding.first .key ))
65
- {
66
64
binding.second ->Execute ();
67
- }
68
65
69
66
break ;
70
67
}
71
68
case InputState::Released:
72
69
{
73
70
if (IsReleased (binding.first .key ))
74
- {
75
71
binding.second ->Execute ();
76
- }
72
+
77
73
break ;
78
74
}
79
75
}
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ namespace Fluffy
54
54
55
55
bool IsPressed (unsigned int key) override ;
56
56
bool IsReleased (unsigned int key) override ;
57
- bool IsPrevious (unsigned int key) override ;
57
+ bool IsHeld (unsigned int key) override ;
58
58
59
59
void HandleInput () override ;
60
60
You can’t perform that action at this time.
0 commit comments