From a7dabea6a32bd6216d82cff60a41e7f98cb33b77 Mon Sep 17 00:00:00 2001 From: Alug Date: Fri, 24 Oct 2025 18:17:59 +0200 Subject: [PATCH] initialize input events to something --- src/sdl/i_video.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 28cb9f2a1..6a3a2c612 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -557,7 +557,7 @@ static void Impl_HandleWindowEvent(SDL_WindowEvent evt) static void Impl_HandleKeyboardEvent(SDL_KeyboardEvent evt, Uint32 type) { - event_t event; + event_t event = {0}; switch (type) { @@ -639,7 +639,7 @@ static void Impl_HandleMouseMotionEvent(SDL_MouseMotionEvent evt) static void Impl_HandleMouseButtonEvent(SDL_MouseButtonEvent evt, Uint32 type) { - event_t event; + event_t event = {0}; // Ignore the event if the mouse is not actually focused on the window. // This can happen if you used the mouse to restore keyboard focus; @@ -694,7 +694,7 @@ static void Impl_HandleMouseButtonEvent(SDL_MouseButtonEvent evt, Uint32 type) static void Impl_HandleMouseWheelEvent(SDL_MouseWheelEvent evt) { - event_t event; + event_t event = {0}; if (USE_MOUSEINPUT) { @@ -730,12 +730,12 @@ static Uint32 hatrepeattimer[MAXSPLITSCREENPLAYERS]; void I_HandleControllerHatRepeat(void) { - static event_t event = {ev_keydown, 0, 0, 0}; - // why bother if theres no controllers? if (numcontrollers == 0) return; + event_t event = {ev_keydown, 0, 0, 0}; + static const SDL_GameControllerButton hatbutt[4] = { SDL_CONTROLLER_BUTTON_DPAD_UP, @@ -838,7 +838,7 @@ static void Impl_HandleControllerAxisEvent(SDL_ControllerAxisEvent evt) static void Impl_HandleControllerHatEvent(SDL_ControllerButtonEvent evt, Uint32 type) { - event_t event; + event_t event = {0}; UINT8 i; static const int hat_buttons_base[] = {KEY_HAT1, KEY_2HAT1, KEY_3HAT1, KEY_4HAT1}; @@ -892,7 +892,7 @@ static void Impl_HandleControllerHatEvent(SDL_ControllerButtonEvent evt, Uint32 static void Impl_HandleControllerButtonEvent(SDL_ControllerButtonEvent evt, Uint32 type) { - event_t event; + event_t event = {0}; UINT8 i; static const int buttons_base[] = {KEY_JOY1, KEY_2JOY1, KEY_3JOY1, KEY_4JOY1};