Improved support for button rollover and hover

Send a combination of mouse and touch events to the web browser entity.

* MouseMove events for when the trigger is not depressed.  This will trigger mouse over and hover events within the browser
* Touch Begin, End, Update events when the trigger is squeezed.  This will give us the iPad like scrolling behavior.
This commit is contained in:
Anthony J. Thibault 2016-08-05 11:32:50 -07:00
parent 90a06f0d40
commit 1dd276c1a5

View file

@ -1314,7 +1314,13 @@ function MyController(hand) {
Reticle.keyboardFocusEntity = focusedEntity;
}
Reticle.sendEntityTouchUpdateEvent(focusedEntity, this.hand, intersectionPoint);
if (!this.triggerSmoothedGrab()) {
// send mouse events for button highlights and tooltips
Reticle.sendEntityMouseMoveEvent(focusedEntity, intersectionPoint);
} else {
// but send touch updates when grab is pressed.
Reticle.sendEntityTouchUpdateEvent(focusedEntity, this.hand, intersectionPoint);
}
if (this.triggerSmoothedGrab() && !this.lastTriggerSmoothedGrab) {
Reticle.sendEntityTouchBeginEvent(focusedEntity, this.hand, intersectionPoint);