1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

[DisplayServer] Implement has_hardware_keyboard method for Android and iOS.

This commit is contained in:
bruvzg
2024-10-02 20:01:27 +03:00
parent 1917bc3454
commit 25f439c573
11 changed files with 56 additions and 1 deletions

View File

@@ -216,6 +216,14 @@ public class GodotIO {
return result;
}
public boolean hasHardwareKeyboard() {
if (edit != null) {
return edit.hasHardwareKeyboard();
} else {
return false;
}
}
public void showKeyboard(String p_existing_text, int p_type, int p_max_input_length, int p_cursor_start, int p_cursor_end) {
if (edit != null) {
edit.showKeyboard(p_existing_text, GodotEditText.VirtualKeyboardType.values()[p_type], p_max_input_length, p_cursor_start, p_cursor_end);

View File

@@ -264,7 +264,7 @@ public class GodotEditText extends EditText {
isModifiedKey;
}
boolean hasHardwareKeyboard() {
public boolean hasHardwareKeyboard() {
Configuration config = getResources().getConfiguration();
boolean hasHardwareKeyboardConfig = config.keyboard != Configuration.KEYBOARD_NOKEYS &&
config.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO;