Skip to content

Commit f0348dd

Browse files
committed
Amend 0f86116, renamed to ImGuiKey_KeyPadEnter Changelog.. (ocornut#2677, ocornut#2005)
1 parent 0f86116 commit f0348dd

10 files changed

+16
-8
lines changed

docs/CHANGELOG.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ Other Changes:
7070
- Style: Attenuated default opacity of ImGuiCol_Separator in Classic and Light styles.
7171
- Style: Added style.ColorButtonPosition (left/right, defaults to ImGuiDir_Right) to move the color button
7272
of ColorEdit3/ColorEdit4 functions to either side of the inputs.
73+
- IO: Added ImGuiKey_KeyPadEnter and support in various back-ends (previously back-ends would need to
74+
specifically redirect key-pad keys to their regular counterpart). This is a temporary attenuating measure
75+
until we actually refactor and add whole sets of keys into the ImGuiKey enum. (#2677, #2005) [@amc522]
7376
- Misc: Made Button(), ColorButton() not trigger an "edited" event leading to IsItemDeactivatedAfterEdit()
7477
returning true. This also effectively make ColorEdit4() not incorrect trigger IsItemDeactivatedAfterEdit()
7578
when clicking the color button to open the picker popup. (#1875)

examples/imgui_impl_allegro5.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
// CHANGELOG
1717
// (minor and older changes stripped away, please see git history for details)
18+
// 2019-07-21: Inputs: Added mapping for ImGuiKey_KeyPadEnter.
1819
// 2019-05-11: Inputs: Don't filter character value from ALLEGRO_EVENT_KEY_CHAR before calling AddInputCharacter().
1920
// 2019-04-30: Renderer: Added support for special ImDrawCallback_ResetRenderState callback to reset render state.
2021
// 2018-11-30: Platform: Added touchscreen support.
@@ -281,8 +282,8 @@ bool ImGui_ImplAllegro5_Init(ALLEGRO_DISPLAY* display)
281282
io.KeyMap[ImGuiKey_Backspace] = ALLEGRO_KEY_BACKSPACE;
282283
io.KeyMap[ImGuiKey_Space] = ALLEGRO_KEY_SPACE;
283284
io.KeyMap[ImGuiKey_Enter] = ALLEGRO_KEY_ENTER;
284-
io.KeyMap[ImGuiKey_EnterSecondary] = ALLEGRO_KEY_PAD_ENTER;
285285
io.KeyMap[ImGuiKey_Escape] = ALLEGRO_KEY_ESCAPE;
286+
io.KeyMap[ImGuiKey_KeyPadEnter] = ALLEGRO_KEY_PAD_ENTER;
286287
io.KeyMap[ImGuiKey_A] = ALLEGRO_KEY_A;
287288
io.KeyMap[ImGuiKey_C] = ALLEGRO_KEY_C;
288289
io.KeyMap[ImGuiKey_V] = ALLEGRO_KEY_V;

examples/imgui_impl_glfw.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
// CHANGELOG
1717
// (minor and older changes stripped away, please see git history for details)
18+
// 2019-07-21: Inputs: Added mapping for ImGuiKey_KeyPadEnter.
1819
// 2019-05-11: Inputs: Don't filter value from character callback before calling AddInputCharacter().
1920
// 2019-03-12: Misc: Preserve DisplayFramebufferScale when main window is minimized.
2021
// 2018-11-30: Misc: Setting up io.BackendPlatformName so it can be displayed in the About Window.
@@ -150,8 +151,8 @@ static bool ImGui_ImplGlfw_Init(GLFWwindow* window, bool install_callbacks, Glfw
150151
io.KeyMap[ImGuiKey_Backspace] = GLFW_KEY_BACKSPACE;
151152
io.KeyMap[ImGuiKey_Space] = GLFW_KEY_SPACE;
152153
io.KeyMap[ImGuiKey_Enter] = GLFW_KEY_ENTER;
153-
io.KeyMap[ImGuiKey_EnterSecondary] = GLFW_KEY_KP_ENTER;
154154
io.KeyMap[ImGuiKey_Escape] = GLFW_KEY_ESCAPE;
155+
io.KeyMap[ImGuiKey_KeyPadEnter] = GLFW_KEY_KP_ENTER;
155156
io.KeyMap[ImGuiKey_A] = GLFW_KEY_A;
156157
io.KeyMap[ImGuiKey_C] = GLFW_KEY_C;
157158
io.KeyMap[ImGuiKey_V] = GLFW_KEY_V;

examples/imgui_impl_glut.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ bool ImGui_ImplGLUT_Init()
5959
io.KeyMap[ImGuiKey_Space] = ' ';
6060
io.KeyMap[ImGuiKey_Enter] = 13; // == CTRL+M
6161
io.KeyMap[ImGuiKey_Escape] = 27;
62+
io.KeyMap[ImGuiKey_KeyPadEnter] = 13; // == CTRL+M
6263
io.KeyMap[ImGuiKey_A] = 'A';
6364
io.KeyMap[ImGuiKey_C] = 'C';
6465
io.KeyMap[ImGuiKey_V] = 'V';

examples/imgui_impl_marmalade.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
// CHANGELOG
1414
// (minor and older changes stripped away, please see git history for details)
15+
// 2019-07-21: Inputs: Added mapping for ImGuiKey_KeyPadEnter.
1516
// 2019-05-11: Inputs: Don't filter value from character callback before calling AddInputCharacter().
1617
// 2018-11-30: Misc: Setting up io.BackendPlatformName/io.BackendRendererName so they can be displayed in the About Window.
1718
// 2018-02-16: Misc: Obsoleted the io.RenderDrawListsFn callback and exposed ImGui_Marmalade_RenderDrawData() in the .h file so you can call it yourself.
@@ -234,8 +235,8 @@ bool ImGui_Marmalade_Init(bool install_callbacks)
234235
io.KeyMap[ImGuiKey_Backspace] = s3eKeyBackspace;
235236
io.KeyMap[ImGuiKey_Space] = s3eKeySpace;
236237
io.KeyMap[ImGuiKey_Enter] = s3eKeyEnter;
237-
io.KeyMap[ImGuiKey_EnterSecondary] = s3eKeyNumPadEnter;
238238
io.KeyMap[ImGuiKey_Escape] = s3eKeyEsc;
239+
io.KeyMap[ImGuiKey_KeyPadEnter] = s3eKeyNumPadEnter;
239240
io.KeyMap[ImGuiKey_A] = s3eKeyA;
240241
io.KeyMap[ImGuiKey_C] = s3eKeyC;
241242
io.KeyMap[ImGuiKey_V] = s3eKeyV;

examples/imgui_impl_osx.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ bool ImGui_ImplOSX_Init()
6161
io.KeyMap[ImGuiKey_Backspace] = 127;
6262
io.KeyMap[ImGuiKey_Space] = 32;
6363
io.KeyMap[ImGuiKey_Enter] = 13;
64-
io.KeyMap[ImGuiKey_EnterSecondary] = 13;
6564
io.KeyMap[ImGuiKey_Escape] = 27;
65+
io.KeyMap[ImGuiKey_KeyPadEnter] = 13;
6666
io.KeyMap[ImGuiKey_A] = 'A';
6767
io.KeyMap[ImGuiKey_C] = 'C';
6868
io.KeyMap[ImGuiKey_V] = 'V';

examples/imgui_impl_sdl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
// CHANGELOG
1919
// (minor and older changes stripped away, please see git history for details)
20+
// 2019-07-21: Inputs: Added mapping for ImGuiKey_KeyPadEnter.
2021
// 2019-04-23: Inputs: Added support for SDL_GameController (if ImGuiConfigFlags_NavEnableGamepad is set by user application).
2122
// 2019-03-12: Misc: Preserve DisplayFramebufferScale when main window is minimized.
2223
// 2018-12-21: Inputs: Workaround for Android/iOS which don't seem to handle focus related calls.
@@ -143,8 +144,8 @@ static bool ImGui_ImplSDL2_Init(SDL_Window* window)
143144
io.KeyMap[ImGuiKey_Backspace] = SDL_SCANCODE_BACKSPACE;
144145
io.KeyMap[ImGuiKey_Space] = SDL_SCANCODE_SPACE;
145146
io.KeyMap[ImGuiKey_Enter] = SDL_SCANCODE_RETURN;
146-
io.KeyMap[ImGuiKey_EnterSecondary] = SDL_SCANCODE_RETURN2;
147147
io.KeyMap[ImGuiKey_Escape] = SDL_SCANCODE_ESCAPE;
148+
io.KeyMap[ImGuiKey_KeyPadEnter] = SDL_SCANCODE_RETURN2;
148149
io.KeyMap[ImGuiKey_A] = SDL_SCANCODE_A;
149150
io.KeyMap[ImGuiKey_C] = SDL_SCANCODE_C;
150151
io.KeyMap[ImGuiKey_V] = SDL_SCANCODE_V;

examples/imgui_impl_win32.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ bool ImGui_ImplWin32_Init(void* hwnd)
7777
io.KeyMap[ImGuiKey_Backspace] = VK_BACK;
7878
io.KeyMap[ImGuiKey_Space] = VK_SPACE;
7979
io.KeyMap[ImGuiKey_Enter] = VK_RETURN;
80-
io.KeyMap[ImGuiKey_EnterSecondary] = VK_RETURN;
8180
io.KeyMap[ImGuiKey_Escape] = VK_ESCAPE;
81+
io.KeyMap[ImGuiKey_KeyPadEnter] = VK_RETURN;
8282
io.KeyMap[ImGuiKey_A] = 'A';
8383
io.KeyMap[ImGuiKey_C] = 'C';
8484
io.KeyMap[ImGuiKey_V] = 'V';

imgui.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -940,8 +940,8 @@ enum ImGuiKey_
940940
ImGuiKey_Backspace,
941941
ImGuiKey_Space,
942942
ImGuiKey_Enter,
943-
ImGuiKey_EnterSecondary,
944943
ImGuiKey_Escape,
944+
ImGuiKey_KeyPadEnter,
945945
ImGuiKey_A, // for text edit CTRL+A: select all
946946
ImGuiKey_C, // for text edit CTRL+C: copy
947947
ImGuiKey_V, // for text edit CTRL+V: paste

imgui_widgets.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3653,7 +3653,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
36533653
}
36543654
state->OnKeyPressed(STB_TEXTEDIT_K_BACKSPACE | k_mask);
36553655
}
3656-
else if (IsKeyPressedMap(ImGuiKey_Enter) || IsKeyPressedMap(ImGuiKey_EnterSecondary))
3656+
else if (IsKeyPressedMap(ImGuiKey_Enter) || IsKeyPressedMap(ImGuiKey_KeyPadEnter))
36573657
{
36583658
bool ctrl_enter_for_new_line = (flags & ImGuiInputTextFlags_CtrlEnterForNewLine) != 0;
36593659
if (!is_multiline || (ctrl_enter_for_new_line && !io.KeyCtrl) || (!ctrl_enter_for_new_line && io.KeyCtrl))

0 commit comments

Comments
 (0)