Skip to content

Conversation

@ngokevin
Copy link
Member

@ngokevin ngokevin commented Jun 14, 2017

Description:

When Vive button was pressed, it would do:

  • handle buttondown -> change to highlight color
  • handle buttonup -> change to default coor
  • handle touchend -> change to highlight color

Vive buttons don't have capacitive touch, remove touch-related handlers.

Changes proposed:

  • Remove touch related handlers from Vive controls. PR has lots of extra changes, but removing those few lines of code is all that's needed to fix the original issue.
  • Clean code, tests, add tests
  • Tested on Vive/Windows/FF Nightly
this.onButtonChanged = bind(this.onButtonChanged, this);
this.onButtonDown = function (evt) { self.onButtonEvent(evt.detail.id, 'down'); };
this.onButtonUp = function (evt) { self.onButtonEvent(evt.detail.id, 'up'); };
this.onButtonTouchStart = function (evt) { self.onButtonEvent(evt.detail.id, 'touchstart'); };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the touchpad is capacitive. Are those events not captured anymore with this PR?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I can adjust to make this continue to emit the trackpadtouchend events...but I just realized maybe the deeper issue is that doing triggerdown/triggerup causes a touchend event from tracked-controls.

Copy link
Member

@dmarcos dmarcos Jun 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might not be a bug. I think those touchstart / touchend are legit. I believe @machenmusik observed that for the first time and probably related to this https://bugzilla.mozilla.org/show_bug.cgi?id=1353523. A slight press on the trigger is considered as a touchstart event.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me, it takes more than a light touch. But I updated the PR to ignore the touch events for buttons that don't have touch. trackpadtouchstart and vice-versa now continue to emit.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coming to this a little late, but IIRC for Vive, the touch start / end events were intentional for analog buttons (trigger) as well as real touch sensitive buttons (trackpad) but are not useful for digital buttons (grip, menu).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants