# Scroll through Joystick/Thumbstick inside XR mode in ScrollViewer

**URL:** <https://forum.babylonjs.com/t/scroll-through-joystick-thumbstick-inside-xr-mode-in-scrollviewer/38342>\
**Category:** Questions\
**Created:** [February 18, 2023, 12:27pm UTC](https://forum.babylonjs.com/t/scroll-through-joystick-thumbstick-inside-xr-mode-in-scrollviewer/38342 "2023-02-18T12:27:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![RohitMallah](https://avatars.discourse-cdn.com/v4/letter/r/5daacb/32.png) [@RohitMallah](https://forum.babylonjs.com/u/RohitMallah)\
**Post date:** [February 18, 2023, 12:27pm UTC](https://forum.babylonjs.com/t/scroll-through-joystick-thumbstick-inside-xr-mode-in-scrollviewer/38342/1 "2023-02-18T12:27:00Z")

</div>

Hello Everyone,  
I am using a scrollViewer to display number of contents inside XR mode. Currently if there are more contents then i use Joystick pointer to scroller and then use that scroller to do the scrolling.

Instead of that, I would like to use Joystick up and down movement for scrolling for scrollViewer.  
Can someone please give the suggestion how can i achieve this ?

I hope i am clear in my requirement

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [February 20, 2023, 10:56am UTC](https://forum.babylonjs.com/t/scroll-through-joystick-thumbstick-inside-xr-mode-in-scrollviewer/38342/2 "2023-02-20T10:56:19Z")

</div>

cc @carolhmj our GUI expert

---

<div class="post-metadata">

**Author:** ![RohitMallah](https://avatars.discourse-cdn.com/v4/letter/r/5daacb/32.png) [@RohitMallah](https://forum.babylonjs.com/u/RohitMallah)\
**Post date:** [February 21, 2023, 7:03am UTC](https://forum.babylonjs.com/t/scroll-through-joystick-thumbstick-inside-xr-mode-in-scrollviewer/38342/3 "2023-02-21T07:03:13Z")

</div>

Can someone please look into this Post ?

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [February 21, 2023, 12:14pm UTC](https://forum.babylonjs.com/t/scroll-through-joystick-thumbstick-inside-xr-mode-in-scrollviewer/38342/4 "2023-02-21T12:14:21Z")

</div>

It will be very helpful for anyone helping you if you share a reproduction - some code, preferably a working playground.

---

<div class="post-metadata">

**Author:** ![RohitMallah](https://avatars.discourse-cdn.com/v4/letter/r/5daacb/32.png) [@RohitMallah](https://forum.babylonjs.com/u/RohitMallah)\
**Post date:** [February 22, 2023, 11:57am UTC](https://forum.babylonjs.com/t/scroll-through-joystick-thumbstick-inside-xr-mode-in-scrollviewer/38342/5 "2023-02-22T11:57:29Z")

</div>

Hi @RaananW

Its just a question. i am yet to implement anything. so asking here as a suggestion. if i want to use Joystick to scroll the scrollviewer… how can i do that ? the same way we are using Mouse onwheel observable outside XR.

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [February 22, 2023, 2:00pm UTC](https://forum.babylonjs.com/t/scroll-through-joystick-thumbstick-inside-xr-mode-in-scrollviewer/38342/6 "2023-02-22T14:00:01Z")

</div>

At the moment there is no way to control the scroll view without wheel-events. One way would be to emulate wheel events. Another would be on us - to expose the API to set the position of the scrollview, based on user input. You will then be able to use the thumbstick’s values to use this API and scroll through.

CC @carolhmj - we can talk about it tomorrow.

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [February 23, 2023, 1:07pm UTC](https://forum.babylonjs.com/t/scroll-through-joystick-thumbstick-inside-xr-mode-in-scrollviewer/38342/7 "2023-02-23T13:07:04Z")

</div>

You can actually already set the scrollviewer’s position by setting the “value” property on the corresponding horizontal and vertical scroll bars, here’s an example that uses “WASD” to control: [Scroll Viewer Example with Grid of Images | Babylon.js Playground (babylonjs.com)](https://playground.babylonjs.com/#C3RDBS#169)

---

<div class="post-metadata">

**Author:** ![RohitMallah](https://avatars.discourse-cdn.com/v4/letter/r/5daacb/32.png) [@RohitMallah](https://forum.babylonjs.com/u/RohitMallah)\
**Post date:** [March 1, 2023, 4:06pm UTC](https://forum.babylonjs.com/t/scroll-through-joystick-thumbstick-inside-xr-mode-in-scrollviewer/38342/8 "2023-03-01T16:06:10Z")

</div>

Thanks Carol & Raanan !!!
