stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

Image viewer scrolling via analog stick

Open papuSpartan opened this issue 3 years ago • 2 comments

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_

papuSpartan avatar Feb 07 '23 23:02 papuSpartan

Put it in a separate js file named imageviewerAnalogStick.js (or something close) and I'll merge it in.

AUTOMATIC1111 avatar Mar 12 '23 06:03 AUTOMATIC1111

all files inside the javascript directory are added to the page. You shouldn't need to do this code with the

AUTOMATIC1111 avatar Mar 14 '23 08:03 AUTOMATIC1111