diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-08-27 08:16:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-27 08:16:19 +0200 |
commit | 91cfe7a2279e8ca6806e13d7d3474d3ec28a2103 (patch) | |
tree | fa8134eb7961515b230f1f4e5334f6956f4694c0 /platform/android/java_godot_wrapper.cpp | |
parent | 2f63811c9aa1d1710dc045e01b1391493243ddde (diff) | |
parent | 5eaaabceaf1403b8348b95830bd177df8a01ef72 (diff) |
Merge pull request #31691 from m4gr3d/fix_oculus_mobile_input_mapping
Update the fallback input mapping for the Oculus mobile devices.
Diffstat (limited to 'platform/android/java_godot_wrapper.cpp')
-rw-r--r-- | platform/android/java_godot_wrapper.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/platform/android/java_godot_wrapper.cpp b/platform/android/java_godot_wrapper.cpp index c7dc1d124c..8194ee6ecf 100644 --- a/platform/android/java_godot_wrapper.cpp +++ b/platform/android/java_godot_wrapper.cpp @@ -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; } |