We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5529

Summary: Android Relative Mouse registers touch hold as tap click
Product: SDL Reporter: eri0o <eri0onpm>
Component: *don't know*Assignee: Ryan C. Gordon <icculus>
Status: NEW --- QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: sylvain.becker
Version: 2.0.12   
Hardware: All   
OS: Android (All)   

Description eri0o 2021-02-04 01:53:16 UTC
When using Relative Mouse mode on Android, when putting the finger on the screen and dragging it, as soon as the finger touches the screen it registers a click.

Ideally it should only register clicks when tapping the screen and holding the finger and dragging would move the mouse without registering the click, when using Relative Mouse mode in Android.
Comment 1 Sylvain 2021-02-04 08:51:39 UTC
Mouse api should only be for mouse, 

Maybe you get synthetic event generated ?


http://hg.libsdl.org/SDL/file/1cde3dd0f44d/include/SDL_hints.h#l350


Call this before creating the window maybe:

    // Set 0 to disable TouchEvent to be duplicated as MouseEvent with SDL_TOUCH_MOUSEID
    SDL_SetHint(SDL_HINT_TOUCH_MOUSE_EVENTS, "0");
    // Set 0 to disable MouseEvent to be duplicated as TouchEvent with SDL_MOUSE_TOUCHID
    SDL_SetHint(SDL_HINT_MOUSE_TOUCH_EVENTS, "0");
Comment 2 eri0o 2021-02-04 11:08:30 UTC
> Mouse api should only be for mouse

I don't get it, what does this means?

If the feature should not be used then it should be removed, if there's interest in fixing, I am proposing a different behavior that I believe is the intended design.
Comment 3 Sylvain 2021-02-04 12:24:26 UTC
I mean the mouse is generating SDL mouse event, and the touchscreen is generating the SDL touch event. This is the design, which is meant to be cross platform also.

The hints below may be the reason if you see mouse events, while touching the screen.