2
0
Эх сурвалжийг харах

Backends: Allegro: Don't call AddInputCharacter if the pressed key has no character. (#3252)

Espyo 5 жил өмнө
parent
commit
f44962c01a

+ 2 - 1
examples/imgui_impl_allegro5.cpp

@@ -357,7 +357,8 @@ bool ImGui_ImplAllegro5_ProcessEvent(ALLEGRO_EVENT *ev)
         return true;
         return true;
     case ALLEGRO_EVENT_KEY_CHAR:
     case ALLEGRO_EVENT_KEY_CHAR:
         if (ev->keyboard.display == g_Display)
         if (ev->keyboard.display == g_Display)
-            io.AddInputCharacter((unsigned int)ev->keyboard.unichar);
+            if (ev->keyboard.unichar != 0)
+                io.AddInputCharacter((unsigned int)ev->keyboard.unichar);
         return true;
         return true;
     case ALLEGRO_EVENT_KEY_DOWN:
     case ALLEGRO_EVENT_KEY_DOWN:
     case ALLEGRO_EVENT_KEY_UP:
     case ALLEGRO_EVENT_KEY_UP: