subsoap / defos

Extra native OS functions for games written using the Defold game engine
Creative Commons Zero v1.0 Universal
121 stars 16 forks source link

Should defos.on_click() be expanded to cover additional user interaction events? #119

Closed britzl closed 3 years ago

britzl commented 3 years ago

I assume the purpose of defos.on_click() for HTML5 is to be able to switch to fullscreen and start music on user interaction to avoid that the browser blocks the request? If that is the case then shouldn't it rather be something like defos.on_interaction() and let that callback trigger on click, touchend and keyup as well?

Example from fork: https://github.com/refold/defos/blob/master/defos/src/defos_html5.cpp#L69-L71

dapetcu21 commented 3 years ago

That's a great suggestion. If you make a PR I'll merge it.

britzl commented 3 years ago

Created PR: https://github.com/subsoap/defos/pull/120