Open nanaktaev opened 2 months ago
I agree that it might be useful to tag which device generated the action, but I don't really see how it matters much in your case? Don't you want to treat a mouse button or single touch in exactly the same way? And you can keep track of if you've handled it or not by setting a flag in on_input and clearing it in update.
Hi!
Don't you want to treat a mouse button or single touch in exactly the same way?
Actually no. Imagine a situation: You have a world map. You can pinch with two fingers to zoom and click/touch to select something on the map. You make a pinch gesture and two input triggers are fired at this moment: touch-multi leads to zooming logic and touch leads to selection logic, so result is the mix of zoom + selecting something. I would like to ignore touch from the screen during touch-multi gestures, but process touch from mouse at all times.
And you can keep track of if you've handled it or not by setting a flag in on_input and clearing it in update.
But I don't know if incoming touch is a part of touch-multi which is happening at the same time or not. Also probably it's not guaranteed which trigger will come first.
May be it will be enough to just ignore touch if touch-multi is happening the same frame. Is the order of incoming input events guaranteed somehow?
Hi! It's impossible to detect if button_left input trigger was emitted by touchscreen tap or by mouse click. It makes life really tought if you want to support mouse and multitouch screen at the same time (hybrid devices).
What happens:
I want to ignore button_left action if it's a touchscreen tap since I already process it as a part of touch_multi, but I want to process it independently if it's a mouse click. But there is no way to tell them apart!
Please add a new field to input action so it will be possible to tell the source of it. Something roughly like this:
This will allow developer to choose how to process/ignore an action based on the source device.
Alternative solution would be to split button_left trigger into two separate triggers - one for mouse, one for screen touch, but that would be breaking change I guess + it will require to change some manuals.
All the best!