[x3d-public] touchTime for all pointing device sensors ?

Andreas Plesch andreasplesch at gmail.com
Wed Oct 25 20:09:37 PDT 2017


Thanks for great input.

I agree with everything and I am also not really sure about common use
cases. Indeed, if there is a need for touchTime it would be possible to
attach a TouchSensor in addition to a drag sensor to an UI element.

Here is the other side. It may be more constructive to ask if there is any
inherent, fatal conflict which requires preventing a touchtime event. In
2d, html allows for essentially any element to emit an onclick event,
suggesting there may be no potential conflicts.

It is always up to the scene author to ensure a good UI experience. So the
question may really be if the author should be given an option which may be
misused but could be useful in some cases given that similar, but not
identical options are already available.

Going through this argument, I am leaning towards just allowing touchtime
events for all mouse sensors since it requires less code and does not
impact performance.

-Andreas

On Oct 25, 2017 7:19 PM, "Michalis Kamburelis" <michalis.kambi at gmail.com>
wrote:

2017-10-25 18:05 GMT+02:00 Andreas Plesch <andreasplesch at gmail.com>:
> touchTime is very similar to isActive except that the mouse still has
> to be over the shape when the mouse button is released. Since isOver
> and isActive are already fields for drag sensors, perhaps touchTime
> should be as well.
>
> touchTime is often used to get a startTime for an TimeSensor to
> trigger an animation. So an example application would be have a drag
> sensor which also acts as a start button; a bit contrived but not very
> much so.
>
> It is true that most of the times the mouse ends up outside of the
> shape after dragging. So touchTime would not be useful as a trigger to
> do something after dragging ends.
>
> But I am looking more for examples where it would lead to some,
> unintended conflict if touchTime were used on a drag sensor.
>

It is technically possible to implement touchTime on all
pointing-device sensors, indeed. But I'm not sure is there a good
use-case for it.

touchTime is like an "OnClick" event of numerous UI libraries.

If a drag sensor reacts to clicks (in addition to reacting to
dragging)... it feels a bit surprising (from the user's point of
view). When you drag something, you don't usually care where is the
pointer at the end, the only thing that matters is how far you
dragged. As you write, "most of the times the mouse ends up outside of
the shape after dragging". It could be surprising that some behavior
(generation of touchTime) is different depending on whether the mouse
was inside or outside the shape at the end.

Drag sensor is like a scrollbar in a traditional 2D UI, while
TouchSensor is like a button. Handling "clicks" on a drag sensor is a
bit like combining scrollbar with a button functionality. Traditional
UIs don't do it --- if you click on a scrollbar, without moving your
mouse, nothing happens.

None of this is a strong argument against adding touchTime to other
pointing-device sensors, so I may definitely be wrong :) I'm mostly
following my intuitions from 2D UI here.

Regards,
Michalis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20171025/4eec291c/attachment-0001.html>


More information about the x3d-public mailing list