diff --git a/Source/Engine/Input/Input.cpp b/Source/Engine/Input/Input.cpp index 22969c752..81411ed76 100644 --- a/Source/Engine/Input/Input.cpp +++ b/Source/Engine/Input/Input.cpp @@ -333,6 +333,8 @@ void Keyboard::OnCharInput(Char c, Window* target) void Keyboard::OnKeyUp(KeyboardKeys key, Window* target) { + if (key >= KeyboardKeys::MAX) + return; Event& e = _queue.AddOne(); e.Type = EventType::KeyUp; e.Target = target; @@ -341,6 +343,8 @@ void Keyboard::OnKeyUp(KeyboardKeys key, Window* target) void Keyboard::OnKeyDown(KeyboardKeys key, Window* target) { + if (key >= KeyboardKeys::MAX) + return; Event& e = _queue.AddOne(); e.Type = EventType::KeyDown; e.Target = target; diff --git a/Source/Engine/Platform/Linux/LinuxPlatform.cpp b/Source/Engine/Platform/Linux/LinuxPlatform.cpp index 0434d8414..5a74d8f68 100644 --- a/Source/Engine/Platform/Linux/LinuxPlatform.cpp +++ b/Source/Engine/Platform/Linux/LinuxPlatform.cpp @@ -2206,6 +2206,10 @@ bool LinuxPlatform::Init() KeyCodeMap[keyCode] = key; } } + else + { + KeyCodeMap[keyCode] = KeyboardKeys::None; + } } Input::Mouse = Impl::Mouse = New();