File tree Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -38,22 +38,23 @@ void DevConsole::OnUpdate()
38
38
if ((key >= 32 ) && (key <= 125 )) inputText += key;
39
39
}
40
40
41
+ int latestKey = Siege::Input::GetLatestKey ();
42
+
41
43
// Remove characters on backspace
42
- if (Siege::Input::IsKeyDown (Siege:: Key::KEY_BACKSPACE) && !inputText.IsEmpty ())
44
+ if (latestKey == Siege::Key::KEY_BACKSPACE && !inputText.IsEmpty ())
43
45
inputText.PopBack ();
44
46
45
47
// Get the last command you ran - only works once.
46
- if (Siege::Input::IsKeyDown (Siege:: Key::KEY_UP) && !lastInput.IsEmpty ())
48
+ if (latestKey == Siege::Key::KEY_UP && !lastInput.IsEmpty ())
47
49
inputText = lastInput;
48
50
49
51
// Process the command on enter
50
- if (Siege::Input::IsKeyDown (Siege:: Key::KEY_ENTER) )
52
+ if (latestKey == Siege::Key::KEY_ENTER)
51
53
{
52
54
// Process the input into command and argument format
53
55
auto args = inputText.Split (' ' );
54
56
Siege::String command (!args.empty () ? args[0 ] : nullptr );
55
57
Siege::String argument (args.size () > 1 ? args[1 ] : nullptr );
56
- command.Erase (0 , 1 );
57
58
58
59
// Run the appropriate instructions for specified command
59
60
if (command == " load" )
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ int main()
44
44
45
45
Siege::Window window (" Render Example" , {WIDTH, HEIGHT});
46
46
47
- window. DisableCursor ();
47
+ Siege::Input:: DisableCursor ();
48
48
49
49
Siege::Input::SetInputWindowSource (reinterpret_cast <GLFWwindow*>(window.GetRawWindow ()));
50
50
@@ -147,7 +147,7 @@ int main()
147
147
currentTime = newTime;
148
148
149
149
window.Update ();
150
- window. ToggleCursor (inputEnabled);
150
+ Siege::Input:: ToggleCursor (inputEnabled);
151
151
152
152
if (Siege::Input::IsKeyJustPressed (Siege::Key::KEY_ESCAPE)) inputEnabled = !inputEnabled;
153
153
Original file line number Diff line number Diff line change 8
8
9
9
#include < core/Statics.h>
10
10
#include < core/entity/Entity.h>
11
- #include < core/render/ ResourceSystem.h>
11
+ #include < core/ResourceSystem.h>
12
12
#include < core/scene/SceneFile.h>
13
13
#include < core/scene/SceneSystem.h>
14
14
#include < utest.h>
You can’t perform that action at this time.
0 commit comments