You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Add OS.has_clipboard() to check clipboard content
This commit is contained in:
@@ -786,10 +786,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