Samsung / GearVRf

The GearVR framework(GearVRf) is an Open Source VR rendering library for application development on VR-supported Android devices.
http://www.gearvrf.org
Apache License 2.0
407 stars 217 forks source link

GearVR TouchPad MotionEvent.AXIS always start in center. #231

Closed DanielNogueiraAndroid closed 9 years ago

DanielNogueiraAndroid commented 9 years ago

I'm having a hard time getting the absolute touch position on GearVR TouchPad, the value of X and Y always start with 0 even if I'm not touching on the center of touch pad. To get position x and y, I'm using :

public class MainActivity extends GVRActivity{
...
    @Override
    public boolean onTouchEvent(MotionEvent event) {
         float x = event.getAxisValue(MotionEvent.AXIS_X);
         float y = event.getAxisValue(MotionEvent.AXIS_Y);
        return super.onTouchEvent(event);
    }
 ...   
}
thomasflynn commented 9 years ago

That is how the touchpad works on the GearVR works. No matter where you touch down on the pad, it reports the initial position as 0 and then gives relative coordinates from there. It's configured that way in the firmware of the touchpad. The touchpad is really only good for taps and swipes.

mteofilo commented 9 years ago

Thank you for the clarification. We'll represent just tap, long press, and swipes in Controls sample. This issue can be closed.