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

Add DisplayServer.clipboard_has() to check clipboard content

This commit is contained in:
Haoyu Qiu
2022-01-19 21:04:52 +08:00
parent 8b8e858778
commit 314f309035
8 changed files with 48 additions and 1 deletions

View File

@@ -95,6 +95,17 @@ String DisplayServerAndroid::clipboard_get() const {
}
}
bool DisplayServerAndroid::clipboard_has() const {
GodotJavaWrapper *godot_java = OS_Android::get_singleton()->get_godot_java();
ERR_FAIL_COND_V(!godot_java, false);
if (godot_java->has_has_clipboard()) {
return godot_java->has_clipboard();
} else {
return DisplayServer::clipboard_has();
}
}
void DisplayServerAndroid::screen_set_keep_on(bool p_enable) {
GodotJavaWrapper *godot_java = OS_Android::get_singleton()->get_godot_java();
ERR_FAIL_COND(!godot_java);