Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RajawaliVR with TouchEvent #26

Open
lavorato opened this issue Mar 3, 2016 · 0 comments
Open

RajawaliVR with TouchEvent #26

lavorato opened this issue Mar 3, 2016 · 0 comments

Comments

@lavorato
Copy link

lavorato commented Mar 3, 2016

Hello folks. I'd like to know if is possible to detect the touch event using the Cardboard in RajawaliVR. I tried some snippets how to handle the TouchEvent but I have no success.

The events are not fired when I touched the screen when I override the onTouchEvent on RajawaliCardboardRenderer class.

@Override public void onTouchEvent(MotionEvent me) { //The MotionEvent "me" has all of the data you need to make animation based on touch if (me.getAction() == MotionEvent.ACTION_DOWN) { //Called once at the start of the touch System.out.println(me.getAction() + " -- " + me.getX() + ", " + me.getY()); } if (me.getAction() == MotionEvent.ACTION_MOVE) { //Called repeatedly as touch point moves System.out.println(me.getAction() + " -- " + me.getX() + ", " + me.getY()); } if (me.getAction() == MotionEvent.ACTION_UP) { //Called once at the end of the touch System.out.println(me.getAction() + " -- " + me.getX() + ", " + me.getY()); } try { Thread.sleep(15); //Small delay to keep touch events from overflowing and decreasing performance } catch (Exception e) { } }

Regards,
Marcos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant