shellspace
shellspace copied to clipboard
Bluetooth mouse support
Using the Android Motion events:
http://developer.android.com/reference/android/view/MotionEvent.html
Have to plumb this through from the Java code:
// VRLib/src/com/oculusvr/vrlib/VrActivity.java:
public static native void nativeKeyEvent(long appPtr, int keyNum, boolean down, int repeatCount );
// VRLib/jni/App.cpp
void Java_com_oculusvr_vrlib_VrActivity_nativeKeyEvent( JNIEnv *jni, jclass clazz,
jlong appPtr, jint key, jboolean down, jint repeatCount )
{
AppLocal * local = ((AppLocal *)appPtr);
// Suspend input until OneTimeInit() has finished to avoid overflowing the message queue on long loads.
if ( local->OneTimeInitCalled )
{
local->GetMessageQueue().PostPrintf( "key %i %i %i", key, down, repeatCount );
}
}
if ( MatchesHead( "key ", msg ) )
{
int key, down, repeatCount;
sscanf( msg, "key %i %i %i", &key, &down, &repeatCount );
KeyEvent( key, down, repeatCount );
return;
}