floooh / sokol

minimal cross-platform standalone C headers

Home Page:https://floooh.github.io/sokol-html5

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sokol_app.h html5: event bubbling followup fixes...

floooh opened this issue · comments

The recent fix to simply let bubble mouse and touch events up to the web page has some undesirable side effects:

Related:

Solution: restore previous default behaviour (mouse, touch and maybe key input does not bubble up by default), and instead add the following config items to sapp_desc:

  • html5_bubble_mouse_events
  • html5_bubble_wheel_events
  • html5_bubble_touch_events
  • html5_bubble_key_events
  • html5_bubble_char_events

...this would be a good opportunity (but a breaking change) to introduce nesting for those platform-specific config items, e.g. (still a good idea, but for a later time)

return (sapp_desc){
    .win32 = {
        ...
    },
    .html5 = {
        ...
    }
};

Fixed via #975