Adds simulated touch as a profile option #2132
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Brought up to date to master from #1718, which I had to close because after a rebase it would not allow me to push to that branch anymore.
For a mouse click, if the click is a right or middle click, or if it's a left click + ctrl, it'll add multitouch_sim to the profile of that touch as well as a property multitouch_sim to the touch. By default this property is False. If the user sets multitouch_sim to true in on_touch_down/move before the touch is released, the touch becomes a simulated multitouch. Otherwise, this touch is removed from the multitouch simulation.
I also set scatter to set multitouch_sim to True when 'multitouch_sim' is in the profile. This seems to work very well, a circle is still shown for a right/middle click, but it's removed instantly when the mouse is released, unless it's in a scatter.
A minor alternative is to by default make it a multitouch, unless the user sets it to False. But this seems unnecessary.
This could be extended such that a user can set any touch to be a multi-touch, even if it didn't originate from e.g. a right click, or even if it's not from a mouse. But that seems more complicated, and would require some kind of function to be attached to the touch which the user can call many times to set/unset it to be multitouch.