Image viewer scrolling via analog stick
Describe what this pull request is trying to achieve. I got very tired of having to hit the left-right modal buttons in order to go to the next image (while using a vr setup). This PR makes it so that you can scroll left to right through images wherever an image gallery is present. But, importantly, in a situation where you don't have a keyboard available.
Additional notes and description of your changes Because you can't actually use webxr events for this, I had to resort to using horizontal scroll-wheel events for the vr joystick functionality. It's definitely something that could be modified. I thought about implementing a sort of scroll velocity where if you are pressing it harder it goes faster but, at least for me, there is too much network lag for that to be useful right now. The scroll delay was mostly just based off of what felt right to me.
This was mostly made to be used with the image browser extension but should work with anything utilizing imageviewer.js.
Environment this was tested in
- OS: Windows, Android(meta quest)
- Browser: Chrome, Firefox nightly, meta quest browser
Screenshots or videos of your changes https://youtu.be/qmHL2mn-RFo
thank you for the help @greggman https://github.com/immersive-web/webxr/issues/995#issuecomment-1407477496_
Put it in a separate js file named imageviewerAnalogStick.js (or something close) and I'll merge it in.
all files inside the javascript directory are added to the page. You shouldn't need to do this code with the