Plumb UTF-8 text support through to NvConnection

This commit is contained in:
Cameron Gutman 2021-08-10 00:14:13 -05:00
parent 310ba646fc
commit ae9282b0af
4 changed files with 17 additions and 1 deletions

View File

@ -367,6 +367,12 @@ public class NvConnection {
}
}
public void sendUtf8Text(final String text) {
if (!isMonkey) {
MoonBridge.sendUtf8Text(text);
}
}
public static String findExternalAddressForMdns(String stunHostname, int stunPort) {
return MoonBridge.findExternalAddressIP4(stunHostname, stunPort);
}

View File

@ -291,6 +291,8 @@ public class MoonBridge {
public static native void sendMouseHighResScroll(short scrollAmount);
public static native void sendUtf8Text(String text);
public static native String getStageName(int stage);
public static native String findExternalAddressIP4(String stunHostName, int stunPort);

@ -1 +1 @@
Subproject commit fa892c53344f76846b27d37cde1b904d745d42b1
Subproject commit a290ec032b6a068a56461bbe4b60798b68a319d5

View File

@ -4,6 +4,7 @@
#include <android/log.h>
#include <arpa/inet.h>
#include <string.h>
JNIEXPORT void JNICALL
Java_com_limelight_nvstream_jni_MoonBridge_sendMouseMove(JNIEnv *env, jclass clazz, jshort deltaX, jshort deltaY) {
@ -54,6 +55,13 @@ Java_com_limelight_nvstream_jni_MoonBridge_sendMouseHighResScroll(JNIEnv *env, j
LiSendHighResScrollEvent(scrollAmount);
}
JNIEXPORT void JNICALL
Java_com_limelight_nvstream_jni_MoonBridge_sendUtf8Text(JNIEnv *env, jclass clazz, jstring text) {
const char* utf8Text = (*env)->GetStringUTFChars(env, text, NULL);
LiSendUtf8TextEvent(utf8Text, strlen(utf8Text));
(*env)->ReleaseStringUTFChars(env, text, utf8Text);
}
JNIEXPORT void JNICALL
Java_com_limelight_nvstream_jni_MoonBridge_stopConnection(JNIEnv *env, jclass clazz) {
LiStopConnection();