Forum Discussion

daniel_kovari's avatar
daniel_kovari
Honored Guest
14 days ago

Getting Analog Values from Joysticks in Spatial SDK Native Android App

Hi, I am trying to create an app that can track the joystick push values as continuous values rather than discrete pushed/not pushed. I am using the Spatial SDK and it seems to only expose getters such as ButtonThumbLL which return an Int representing whether they were pressed or not. I saw a similar post about 4 months ago that was left unanswered: Interface of getting Controller joystick travel range | Meta Community Forums - 1336257. I am curious if anyone knows and idiomatic way of getting the continuous values of how far the joysticks are pushed. Thank you.

5 Replies

  • Sorry, just to clarify, I am using the getter to mask out buttonState. I am only getting a binary on and off for left, right, up, and down.

  • Hello there!

    If you go to your developer dashboard, on the left hand side go to team > contact us. From the window it opened, select new in the top right, set your topic as technical support and fill out the rest of the form to the best of your ability. Our specialists will then take a look at this for you!

    If you need any additional assistance, let me know! 

    Hope this helps!

  • ymzh's avatar
    ymzh
    Meta Employee

    Hi daniel_kovari​!

     You can get the scroll amount when scrolling a panel by accessing the scrollInfo property of a PointerEvent. Unfortunately we don't support getting generic axis values at any time.


    If you need any additional assistance, let me know! 


    -Y

  • I'm using IsdkSystem.registerObserver to receive PointerEvent objects for scroll gestures on a control panel. Currently, I can access event.scrollInfo.x and event.scrollInfo.y, but I need to differentiate between scroll events from the left controller vs. the right controller.

    Does PointerEvent expose which controller/hand generated the event?

    Is there a way to register observers for only one controller (e.g., only right controller events)

→ Find helpful resources to begin your development journey in Getting Started

→ Get the latest information about HorizonOS development in News & Announcements.

→ Access Start program mentor videos and share knowledge, tutorials, and videos in Community Resources.

→ Get support or provide help in Questions & Discussions.

→ Show off your work in What I’m Building to get feedback and find playtesters.

→ Looking for documentation?  Developer Docs

→ Looking for account support?  Support Center

→ Looking for the previous forum?  Forum Archive

→ Looking to join the Start program? Apply here.

 

Recent Discussions