GVRBaseController getCursorController(GVRContext context) { Log.d(TAG, "Creating Mouse Device"); if (threadStarted == false) { Log.d(TAG, "Starting " + THREAD_NAME); thread.start(); thread.prepareHandler(); threadStarted = true; } GVRMouseController controller = new GVRMouseController(context, GVRCursorType.MOUSE, thread); int id = controller.getId(); controllers.append(id, controller); return controller; }
private void processMouseInput(int uniqueId, MotionEvent motionEvent, int historyPos) { if (getNormalizedCoordinates(motionEvent)) { GVRMouseController device = controllers.get(uniqueId); device.processMouseEvent(this.x, this.y, this.z, isActive); } }