mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-27 17:28:41 +00:00
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.
This commit is contained in:
parent
ec15e35ad7
commit
b906ed4e59
2 changed files with 16 additions and 11 deletions
|
@ -19,6 +19,10 @@ public class MtNativeActivity extends NativeActivity {
|
|||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
}
|
||||
|
||||
|
||||
public void copyAssets() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue