You've already forked godot
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:
@@ -660,10 +660,14 @@ public class Godot extends Fragment implements SensorEventListener, IDownloaderC
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasClipboard() {
|
||||
return mClipboard.hasPrimaryClip();
|
||||
}
|
||||
|
||||
public String getClipboard() {
|
||||
String copiedText = "";
|
||||
|
||||
if (mClipboard.getPrimaryClip() != null) {
|
||||
if (mClipboard.hasPrimaryClip()) {
|
||||
ClipData.Item item = mClipboard.getPrimaryClip().getItemAt(0);
|
||||
copiedText = item.getText().toString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user