From b906ed4e5902785ab6f15012666e344c98fabe14 Mon Sep 17 00:00:00 2001 From: Maksim Gamarnik Date: Sat, 14 May 2016 23:35:56 +1000 Subject: Fix locked hardware buttons on Android Fixes #2122 Fixes #1454 Addendum (est31) According from its docs in android_native_app_glue.h (from the NDK), the onInputEvent should "Return 1 if you have handled the event, 0 for any default dispatching". Before, we always returned 1, meaning we blocked all hardware keys to be given to the OS. This broke the volume keys and has caused #2122 and #1454. Although it bases on lots of guesswork, it can probably safely be said that CGUIEnvironment::postEventFromUser returns true if the event was handled, and false if not. Therefore, set the status variable depending on what postEventFromUser returned. --- .../android/src/main/java/net.minetest.minetest/MtNativeActivity.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'build/android/src/main/java') diff --git a/build/android/src/main/java/net.minetest.minetest/MtNativeActivity.java b/build/android/src/main/java/net.minetest.minetest/MtNativeActivity.java index fc95a8379..3173a71f4 100644 --- a/build/android/src/main/java/net.minetest.minetest/MtNativeActivity.java +++ b/build/android/src/main/java/net.minetest.minetest/MtNativeActivity.java @@ -19,6 +19,10 @@ public class MtNativeActivity extends NativeActivity { public void onDestroy() { super.onDestroy(); } + + @Override + public void onBackPressed() { + } public void copyAssets() { -- cgit v1.2.3