-
-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mouse down event not registered properly when there is no mouse motion #20
Comments
I think I have a better understanding now. ctx->hover_root is not set on mousedown and the mu_mouse_over called from mu_update_control fails because in_hover_root returns false. |
Ok I think I found the issue. The problem lies with ctx->last_hover_root. Since it is null at the beginning, the first move and click will be lost. This never happens when we send down mouse moves every frame as ctx->last_hover_root will be quickly set to something valid. I think I will fix my problem by sending fake mouse moves at the window header coordinates. |
Got the fix! Touchscreen now works perfectly. In microui.c changed line 654: In microui.c added a new line at 1042: |
@uberyoji do you still have the modified |
@ericoporto The most recently commit available when uberyoji wrote their comment is c988730 (Committed on Oct 6, 2019).
If you have a local copy of the repository (from |
I recently ported the code to a project I am working on the nintendo switch. Since I am using touchscreen, there are no motion message being sent (unless when dragging). Motion occurs only when a touch is inputed.
Seems controls need to be hovered first thru motion before mouse down is processed properly.
I tried to debug it a little. I believe the problem occurs in mu_update_control when the context hover id is set.
To reproduce the issue just disable the processing of motion in the sdl message handler. You'll notice you need to click several time to get a proper mouse down.
I'll continue to investigate, let me know if you have some ideas.
The text was updated successfully, but these errors were encountered: