You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Enable BUTTON_FORWARD and BUTTON_BACK mouse buttons on Android
This commit is contained in:
@@ -909,15 +909,10 @@ class Godot(private val context: Context) {
|
||||
}
|
||||
|
||||
fun onBackPressed() {
|
||||
var shouldQuit = true
|
||||
for (plugin in pluginRegistry.allPlugins) {
|
||||
if (plugin.onMainBackPressed()) {
|
||||
shouldQuit = false
|
||||
}
|
||||
}
|
||||
if (shouldQuit) {
|
||||
renderView?.queueOnRenderThread { GodotLib.back() }
|
||||
plugin.onMainBackPressed()
|
||||
}
|
||||
renderView?.queueOnRenderThread { GodotLib.back() }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -154,10 +154,6 @@ public class GodotInputHandler implements InputManager.InputDeviceListener, Sens
|
||||
}
|
||||
|
||||
public boolean onKeyUp(final int keyCode, KeyEvent event) {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (keyCode == KeyEvent.KEYCODE_VOLUME_UP || keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) {
|
||||
return false;
|
||||
}
|
||||
@@ -183,13 +179,6 @@ public class GodotInputHandler implements InputManager.InputDeviceListener, Sens
|
||||
}
|
||||
|
||||
public boolean onKeyDown(final int keyCode, KeyEvent event) {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
||||
godot.onBackPressed();
|
||||
// press 'back' button should not terminate program
|
||||
//normal handle 'back' event in game logic
|
||||
return true;
|
||||
}
|
||||
|
||||
if (keyCode == KeyEvent.KEYCODE_VOLUME_UP || keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user