1
0
mirror of synced 2025-01-31 03:53:44 +01:00

fix: Allow Numpad Enter to work in text editor (#645)

Fixes #590
This commit is contained in:
ogarvey 2022-08-03 18:52:45 +01:00 committed by GitHub
parent 47166db166
commit 09a1e59b8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -649,7 +649,7 @@ void TextEditor::HandleKeyboardInputs() {
Cut();
else if (ctrl && !shift && !alt && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_A)))
SelectAll();
else if (!IsReadOnly() && !ctrl && !shift && !alt && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Enter)))
else if (!IsReadOnly() && !ctrl && !shift && !alt && (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Enter)) || ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_KeyPadEnter))))
EnterCharacter('\n', false);
else if (!IsReadOnly() && !ctrl && !alt && ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Tab)))
EnterCharacter('\t', shift);