v3.2.2: fixed iOS keyboard not showing return key for multiline

This commit is contained in:
Evan Debenham
2025-08-22 14:04:41 -04:00
parent 0b97ab0c7c
commit 9eaf2618f7
4 changed files with 17 additions and 6 deletions

View File

@@ -183,7 +183,7 @@ public class PointerEvent {
}
if (clearKeyboardThisPress){
//most press events should clear the keyboard
Game.platform.setOnscreenKeyboardVisible(false);
Game.platform.setOnscreenKeyboardVisible(false, false);
}
}
pointerEvents.clear();

View File

@@ -141,13 +141,13 @@ public class TextInput extends Component {
textField.setOnscreenKeyboard(new TextField.OnscreenKeyboard() {
@Override
public void show(boolean visible) {
Game.platform.setOnscreenKeyboardVisible(visible);
Game.platform.setOnscreenKeyboardVisible(visible, multiline);
}
});
container.setActor(textField);
stage.setKeyboardFocus(textField);
Game.platform.setOnscreenKeyboardVisible(true);
Game.platform.setOnscreenKeyboardVisible(true, multiline);
}
public void enterPressed(){
@@ -258,7 +258,7 @@ public class TextInput extends Component {
stage.dispose();
skin.dispose();
Game.inputHandler.removeInputProcessor(stage);
Game.platform.setOnscreenKeyboardVisible(false);
Game.platform.setOnscreenKeyboardVisible(false, false);
if (!DeviceCompat.isDesktop()) Game.platform.updateSystemUI();
}
}

View File

@@ -22,6 +22,7 @@
package com.watabou.utils;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.PixmapPacker;
@@ -61,8 +62,9 @@ public abstract class PlatformSupport {
return Gdx.net.openURI( uri );
}
public void setOnscreenKeyboardVisible(boolean value){
Gdx.input.setOnscreenKeyboardVisible(value);
public void setOnscreenKeyboardVisible(boolean value, boolean multiline){
//by default ignore multiline
Gdx.input.setOnscreenKeyboardVisible(value, Input.OnscreenKeyboardType.Default);
}
//TODO should consider spinning this into its own class, rather than platform support getting ever bigger