[ui] Return whether events to imui were consumed

Needed for non-ui handling of events (eg, mouse interaction with the
main screen).
This commit is contained in:
Bill Currie 2023-07-14 11:25:50 +09:00
parent 8068233fb2
commit bf3d57cdbf
2 changed files with 3 additions and 2 deletions

View file

@ -99,7 +99,7 @@ void IMUI_DestroyContext (imui_ctx_t *ctx);
void IMUI_SetVisible (imui_ctx_t *ctx, bool visible);
void IMUI_SetSize (imui_ctx_t *ctx, int xlen, int ylen);
void IMUI_ProcessEvent (imui_ctx_t *ctx, const struct IE_event_s *ie_event);
bool IMUI_ProcessEvent (imui_ctx_t *ctx, const struct IE_event_s *ie_event);
void IMUI_BeginFrame (imui_ctx_t *ctx);
void IMUI_Draw (imui_ctx_t *ctx);

View file

@ -307,7 +307,7 @@ IMUI_SetSize (imui_ctx_t *ctx, int xlen, int ylen)
Canvas_SetLen (ctx->csys, ctx->canvas, (view_pos_t) { xlen, ylen });
}
void
bool
IMUI_ProcessEvent (imui_ctx_t *ctx, const IE_event_t *ie_event)
{
if (ie_event->type == ie_mouse) {
@ -326,6 +326,7 @@ IMUI_ProcessEvent (imui_ctx_t *ctx, const IE_event_t *ie_event)
ctx->key_code = k->code;
ctx->unicode = k->unicode;
}
return ctx->hot != nullent || ctx->active != nullent;
}
void