-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cardboard support for cursor-controller #343
Conversation
…en until we upgrade to aframe 0.8.2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one comment. LGTM otherwise.
@@ -370,10 +376,8 @@ AFRAME.registerComponent("cursor-controller", { | |||
}, | |||
|
|||
_handleEnterVR: function() { | |||
if (AFRAME.utils.device.checkHeadsetConnected()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was it necessary to remove this check? In theory it should return true because the polyfill provides a "Cardboard" headset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if thats true, at least it wasn't in the older version of the polyfill. But regardless listening to just enter/exit VR should be sufficient. That check was mostly just there as a holdover from before when we only used the cursor for 2d mode.
@@ -93,6 +93,8 @@ AFRAME.registerComponent("cursor-controller", { | |||
this.data.playerRig.addEventListener(this.data.primaryUp, this._handlePrimaryUp); | |||
this.data.playerRig.addEventListener(this.data.grabEvent, this._handlePrimaryDown); | |||
this.data.playerRig.addEventListener(this.data.releaseEvent, this._handlePrimaryUp); | |||
this.data.playerRig.addEventListener("gamepadbuttondown", this._handlePrimaryDown); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(apologies in advance, as I know this is a WIP PR.)
is this a correct branch? this appears to be for #364 perhaps?
btw, gamepadbuttondown
/gamepadbuttonup
/gamepadaxismove
are events that are proprietary to and work only in Firefox. (see w3c/gamepad#15 for context.) also, only in Firefox Nightly/Beta is the about:config
flag dom.gamepad.non_standard_events
set to true
; in release-channel Firefox, it's false
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gamepadbuttondown
is fired by https://github.com/donmccurdy/aframe-extras/blob/master/src/controls/gamepad-controls.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gd lol, I should've checked before spamming you with unnecessary info. thanks!
Properly show cursor when in cardboard. Note: cardboard input is broken until we upgrade to aframe 0.8.2.