Skip to content

Commit

Permalink
Fix mouse button presses
Browse files Browse the repository at this point in the history
  • Loading branch information
ubkp committed Oct 16, 2023
1 parent 6f3afc1 commit 148748a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/rcore_desktop_sdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,9 @@ void PollInputEvents(void)
CORE.Input.Keyboard.keyRepeatInFrame[i] = 0;
}

// Register previous mouse states
for (int i = 0; i < MAX_MOUSE_BUTTONS; i++) CORE.Input.Mouse.previousButtonState[i] = CORE.Input.Mouse.currentButtonState[i];

// Poll input events for current plaform
//-----------------------------------------------------------------------------
/*
Expand Down Expand Up @@ -613,7 +616,10 @@ void PollInputEvents(void)
{
CORE.Input.Mouse.currentButtonState[event.button.button - 1] = 1;
} break;
case SDL_MOUSEBUTTONUP: break;
case SDL_MOUSEBUTTONUP:
{
CORE.Input.Mouse.currentButtonState[event.button.button - 1] = 0;
} break;
case SDL_MOUSEWHEEL:
{
CORE.Input.Mouse.currentWheelMove.x = (float)event.wheel.x;
Expand Down

0 comments on commit 148748a

Please sign in to comment.