|
@@ -18,6 +18,7 @@
|
|
|
|
|
|
// CHANGELOG
|
|
|
// (minor and older changes stripped away, please see git history for details)
|
|
|
+// 2022-03-22: Inputs: Added support for extra mouse buttons (SDL_BUTTON_X1/SDL_BUTTON_X2).
|
|
|
// 2022-02-04: Added SDL_Renderer* parameter to ImGui_ImplSDL2_InitForSDLRenderer(), so we can use SDL_GetRendererOutputSize() instead of SDL_GL_GetDrawableSize() when bound to a SDL_Renderer.
|
|
|
// 2022-01-26: Inputs: replaced short-lived io.AddKeyModsEvent() (added two weeks ago)with io.AddKeyEvent() using ImGuiKey_ModXXX flags. Sorry for the confusion.
|
|
|
// 2021-01-20: Inputs: calling new io.AddKeyAnalogEvent() for gamepad support, instead of writing directly to io.NavInputs[].
|
|
@@ -267,6 +268,8 @@ bool ImGui_ImplSDL2_ProcessEvent(const SDL_Event* event)
|
|
|
if (event->button.button == SDL_BUTTON_LEFT) { mouse_button = 0; }
|
|
|
if (event->button.button == SDL_BUTTON_RIGHT) { mouse_button = 1; }
|
|
|
if (event->button.button == SDL_BUTTON_MIDDLE) { mouse_button = 2; }
|
|
|
+ if (event->button.button == SDL_BUTTON_X1) { mouse_button = 3; }
|
|
|
+ if (event->button.button == SDL_BUTTON_X2) { mouse_button = 4; }
|
|
|
if (mouse_button == -1)
|
|
|
break;
|
|
|
io.AddMouseButtonEvent(mouse_button, (event->type == SDL_MOUSEBUTTONDOWN));
|