You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This can be done in user code, my assumption is also that the library does not probably want to handle this stuff. I suspect you should be using a property of the event that sets the pointer state in order to check what button causes it. This could be different depending on the library that you're using for rendering. For instance with clay+SDL3:
SDL_AppResultSDL_AppEvent(void*appstate, SDL_Event*event)
{
SDL_AppResultret_val=SDL_APP_CONTINUE;
switch (event->type) {
caseSDL_EVENT_MOUSE_BUTTON_DOWN:
Clay_SetPointerState((Clay_Vector2) { event->button.x, event->button.y },
event->button.button==SDL_BUTTON_LEFT);
if (event->button.button==SDL_BUTTON_RIGHT) {
app_state->context_menu.x=event->button.x;
app_state->context_menu.y=event->button.y;
app_state->context_menu.visible= true;
} elseapp_state->context_menu.visible= false;
break;
};
returnret_val;
}
// Then use that to show something in SDL_AppIterate:Clay_BeginLayout();
CLAY({
.id=CLAY_ID("MainContainer")
}) {
// Context menuif (app_state->context_menu.visible) {
CLAY({
.id=CLAY_ID("ContextMenu"),
.floating= {
.attachTo=CLAY_ATTACH_TO_PARENT,
.attachPoints= {
.parent=CLAY_ATTACH_POINT_LEFT_TOP
},
},
}) { /* Contents of the menu here */ }
}
It would be helpful to capture right clicks (and possibly more mouse buttons) in the same way as left.
I assume it was a design decision to have omitted this ability, but I thought I would raise the issue just in case it wasn't.
The text was updated successfully, but these errors were encountered: