Skip to content
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

simulated mouse events duplicate touch events #755

Closed
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Closed

simulated mouse events duplicate touch events #755

SDLBugzilla opened this issue Feb 10, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 2.0
Reported for operating system, platform: Android (All), All

Comments on the original bug report:

On 2013-02-07 15:52:30 +0000, wrote:

On Android and UIKit, when SDL sees a touch/finger event, it also sends a mouse motion or mouse button event. When the user touches their device, the application will receive a touch event as well as a mouse down event. This breaks existing applications which handle both types of events. Applications cannot tell whether a mouse event was already handled as a touch event, is about to be handled as a touch event, or is a new event.

Instead of removing the duplicate events, this patch adds a new hint, SDL_HINT_SIMULATE_INPUT_EVENTS, leaving the above described behavior as the default, but permitting portable apps to disable duplicate events. The hint system seems the least intrusive approach, but is inefficient, so I added a flag in the SDL_Mouse struct to mirror the hint.

Portable apps should either (1) not handle touch events at all, or (2) call SDL_SetHint(SDL_HINT_SIMULATE_INPUT_EVENTS, "0") to disable duplicate events.

On 2013-02-16 02:01:10 +0000, Philipp Wiesemann wrote:

The patch was not attached to the bug.

On 2013-02-16 10:40:38 +0000, wrote:

Created attachment 1044
patch to add the new hint support

On 2013-03-02 23:46:24 +0000, Sam Lantinga wrote:

You can now tell if a mouse event was simulated by touch input. The mouse event 'which' field will be set to the value SDL_TOUCH_MOUSEID.

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

No branches or pull requests

1 participant