Skip to content
This repository has been archived by the owner on Feb 17, 2022. It is now read-only.

Why emscripten_set_mouseup_callback use EMSCRIPTEN_EVENT_TARGET_DOCUMENT as traget #137

Open
LionKenedi95 opened this issue Feb 10, 2021 · 1 comment

Comments

@LionKenedi95
Copy link

Hello.

Can you tell me why emscripten_set_mouseup_callback uses document as target, when emscripten_set_mousedown_callback takes data-> canvas_id as target. This may be a mistake.

In my case, this solution breaks the standard input behavior on the page, which is very strange.

Thanks in advance for your reply and sorry for my english :)

@Daft-Freak
Copy link
Member

It does that to handle pressing inside the canvas, moving outside of it then releasing. SDL expects to still get the mouse up event in that case. (b1060d9)

It should only prevent the default action if the mouse was inside though... (ed82ab1)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants