1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Update the fallback input mapping for the Oculus mobile devices.

This commit is contained in:
fhuya
2019-08-26 17:47:13 -07:00
parent be99e7b68f
commit 5eaaabceaf
8 changed files with 195 additions and 48 deletions

View File

@@ -63,6 +63,7 @@ GodotJavaWrapper::GodotJavaWrapper(JNIEnv *p_env, jobject p_godot_instance) {
_get_surface = p_env->GetMethodID(cls, "getSurface", "()Landroid/view/Surface;");
_is_activity_resumed = p_env->GetMethodID(cls, "isActivityResumed", "()Z");
_vibrate = p_env->GetMethodID(cls, "vibrate", "(I)V");
_get_input_fallback_mapping = p_env->GetMethodID(cls, "getInputFallbackMapping", "()Ljava/lang/String;");
}
GodotJavaWrapper::~GodotJavaWrapper() {
@@ -166,6 +167,16 @@ String GodotJavaWrapper::get_clipboard() {
}
}
String GodotJavaWrapper::get_input_fallback_mapping() {
if (_get_input_fallback_mapping) {
JNIEnv *env = ThreadAndroid::get_env();
jstring fallback_mapping = (jstring)env->CallObjectMethod(godot_instance, _get_input_fallback_mapping);
return jstring_to_string(fallback_mapping, env);
} else {
return String();
}
}
bool GodotJavaWrapper::has_set_clipboard() {
return _set_clipboard != 0;
}