diff options
author | wombatstampede <donning@informenta.de> | 2019-05-03 15:56:44 +0200 |
---|---|---|
committer | wombatstampede <donning@informenta.de> | 2019-05-28 18:23:30 +0200 |
commit | 6e46701e646928db18a591eee2433bfb37ab8453 (patch) | |
tree | 150db59dc5e567df7614e86d33a374707037e57a /platform/android/java_godot_wrapper.cpp | |
parent | b71254a86134233949ee9ebe5855fa509f34824c (diff) | |
download | redot-engine-6e46701e646928db18a591eee2433bfb37ab8453.tar.gz |
Android: Include Joysticks/Gamepads which are available on app start.
Diffstat (limited to 'platform/android/java_godot_wrapper.cpp')
-rw-r--r-- | platform/android/java_godot_wrapper.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/platform/android/java_godot_wrapper.cpp b/platform/android/java_godot_wrapper.cpp index 101a1d76c6..e92d4437b1 100644 --- a/platform/android/java_godot_wrapper.cpp +++ b/platform/android/java_godot_wrapper.cpp @@ -59,6 +59,7 @@ GodotJavaWrapper::GodotJavaWrapper(JNIEnv *p_env, jobject p_godot_instance) { _get_clipboard = p_env->GetMethodID(cls, "getClipboard", "()Ljava/lang/String;"); _set_clipboard = p_env->GetMethodID(cls, "setClipboard", "(Ljava/lang/String;)V"); _request_permission = p_env->GetMethodID(cls, "requestPermission", "(Ljava/lang/String;)Z"); + _init_input_devices = p_env->GetMethodID(cls, "initInputDevices", "()V"); } GodotJavaWrapper::~GodotJavaWrapper() { @@ -183,3 +184,10 @@ bool GodotJavaWrapper::request_permission(const String &p_name) { return false; } } + +void GodotJavaWrapper::init_input_devices() { + if (_init_input_devices) { + JNIEnv *env = ThreadAndroid::get_env(); + env->CallVoidMethod(godot_instance, _init_input_devices); + } +} |