diff options
Diffstat (limited to 'src/ui/widget.c')
-rw-r--r-- | src/ui/widget.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ui/widget.c b/src/ui/widget.c index 56b05aa6..51841d64 100644 --- a/src/ui/widget.c +++ b/src/ui/widget.c | |||
@@ -419,6 +419,17 @@ iBool processEvent_Widget(iWidget *d, const SDL_Event *ev) { | |||
419 | return iTrue; | 419 | return iTrue; |
420 | } | 420 | } |
421 | } | 421 | } |
422 | else if (d->flags & commandOnClick_WidgetFlag && (ev->type == SDL_MOUSEBUTTONDOWN || | ||
423 | ev->type == SDL_MOUSEBUTTONUP) && | ||
424 | contains_Widget(d, init_I2(ev->button.x, ev->button.y))) { | ||
425 | postCommand_Widget(d, | ||
426 | "mouse.clicked arg:%d button:%d coord:%d %d", | ||
427 | ev->type == SDL_MOUSEBUTTONDOWN ? 1 : 0, | ||
428 | ev->button.button, | ||
429 | ev->button.x, | ||
430 | ev->button.y); | ||
431 | return iTrue; | ||
432 | } | ||
422 | switch (ev->type) { | 433 | switch (ev->type) { |
423 | case SDL_USEREVENT: { | 434 | case SDL_USEREVENT: { |
424 | if (ev->user.code == command_UserEventCode && d->commandHandler && | 435 | if (ev->user.code == command_UserEventCode && d->commandHandler && |