mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Add DisplayServer.clipboard_has() to check clipboard content
This commit is contained in:
parent
8b8e858778
commit
314f309035
8 changed files with 48 additions and 1 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue