Skip to content

Commit d0da79c

Browse files
committed
Defining IMGUI_DISABLE_OBSOLETE_FUNCTIONS now automaticaly define IMGUI_DISABLE_OBSOLETE_KEYIO. (#4921)
1 parent ab522dd commit d0da79c

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

docs/CHANGELOG.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ Breaking changes:
6868
as earlier name was misleading. Kept inline redirection function. (#4631)
6969
- IO: Removed io.MetricsActiveAllocations introduced in 1.63, was displayed in Metrics and unlikely to
7070
be accessed by end-user. Value still visible in the UI and easily to recompute from a delta.
71+
- Defining IMGUI_DISABLE_OBSOLETE_FUNCTIONS now automaticaly define IMGUI_DISABLE_OBSOLETE_KEYIO. (#4921)
7172
- Removed IM_OFFSETOF() macro in favor of using offsetof() available in C++11. Kept redirection define. (#4537)
7273
- ListBox, Combo: Changed signature of "name getter" callback in old one-liner ListBox()/Combo() apis.
7374
Before:

imconfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
//---- Don't define obsolete functions/enums/behaviors. Consider enabling from time to time after updating to clean your code of obsolete function/names.
3030
//#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
31-
//#define IMGUI_DISABLE_OBSOLETE_KEYIO // 1.87: disable legacy io.KeyMap[]+io.KeysDown[] in favor io.AddKeyEvent(). This will be folded into IMGUI_DISABLE_OBSOLETE_FUNCTIONS in a few versions.
31+
//#define IMGUI_DISABLE_OBSOLETE_KEYIO // 1.87+ disable legacy io.KeyMap[]+io.KeysDown[] in favor io.AddKeyEvent(). This is automatically done by IMGUI_DISABLE_OBSOLETE_FUNCTIONS.
3232

3333
//---- Disable all of Dear ImGui or don't implement standard windows/tools.
3434
// It is very strongly recommended to NOT disable the demo windows and debug tool during development. They are extremely useful in day to day work. Please read comments in imgui_demo.cpp.

imgui.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,6 +1425,11 @@ enum ImGuiSortDirection_
14251425
ImGuiSortDirection_Descending = 2 // Descending = 9->0, Z->A etc.
14261426
};
14271427

1428+
// Since 1.90, defining IMGUI_DISABLE_OBSOLETE_FUNCTIONS automatically defines IMGUI_DISABLE_OBSOLETE_KEYIO as well.
1429+
#if defined(IMGUI_DISABLE_OBSOLETE_FUNCTIONS) && !defined(IMGUI_DISABLE_OBSOLETE_KEYIO)
1430+
#define IMGUI_DISABLE_OBSOLETE_KEYIO
1431+
#endif
1432+
14281433
// A key identifier (ImGuiKey_XXX or ImGuiMod_XXX value): can represent Keyboard, Mouse and Gamepad values.
14291434
// All our named keys are >= 512. Keys value 0 to 511 are left unused as legacy native/opaque key values (< 1.87).
14301435
// Since >= 1.89 we increased typing (went from int to enum), some legacy code may need a cast to ImGuiKey.

0 commit comments

Comments
 (0)