Skip to content

Bluetooth mouse support #9

@wadetb

Description

@wadetb

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; 
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions