@@ -206,7 +206,7 @@ void RegisterTests_Nav(ImGuiTestEngine* e)
206
206
207
207
// ## Test that Alt toggle layer, test that AltGr doesn't.
208
208
// ## Test that toggling layer steals active id.
209
- // ## Test that toggling layer is canceled by character typing (#370)
209
+ // ## Test that toggling layer is canceled by character typing or any other key (#370)
210
210
// ## Test that ESC closes a menu
211
211
// All those are performed on child and popups windows as well.
212
212
t = IM_REGISTER_TEST (e, " nav" , " nav_menu_alt_key" );
@@ -337,6 +337,18 @@ void RegisterTests_Nav(ImGuiTestEngine* e)
337
337
ctx->KeyUp (ImGuiMod_Alt);
338
338
IM_CHECK (g.NavLayer == ImGuiNavLayer_Main);
339
339
IM_CHECK_EQ (g.ActiveId , input_id);
340
+ ctx->KeyPress (ImGuiKey_Escape);
341
+
342
+ #if IMGUI_VERSION_NUM >= 19111
343
+ // Test that toggling layer is canceled by character typing (#370)
344
+ IM_CHECK_EQ (g.ActiveId , 0u );
345
+ ctx->KeyDown (ImGuiMod_Alt);
346
+ ctx->KeyPress (ImGuiKey_Apostrophe);
347
+ ctx->KeyUp (ImGuiMod_Alt);
348
+ IM_CHECK (g.NavLayer == ImGuiNavLayer_Main);
349
+ IM_CHECK_EQ (g.ActiveId , 0u );
350
+ #endif
351
+
340
352
#endif
341
353
}
342
354
};
0 commit comments