Package io.github.libsdl4j.api.clipboard
Class SdlClipboard
- java.lang.Object
-
- io.github.libsdl4j.api.clipboard.SdlClipboard
-
public final class SdlClipboard extends Object
Definitions from file SDL_clipboard.hInclude file for SDL clipboard handling
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
SDL_GetClipboardText()
Get UTF-8 text from the clipboard, which must be freed with SDL_free().static boolean
SDL_HasClipboardText()
Query whether the clipboard exists and contains a non-empty text string.static int
SDL_SetClipboardText(String text)
Put UTF-8 text into the clipboard.
-
-
-
Method Detail
-
SDL_SetClipboardText
public static int SDL_SetClipboardText(String text)
Put UTF-8 text into the clipboard.- Parameters:
text
- the text to store in the clipboard- Returns:
- 0 on success or a negative error code on failure; call SDL_GetError() for more information.
- Since:
- This function is available since SDL 2.0.0.
- See Also:
SDL_GetClipboardText()
,SDL_HasClipboardText()
-
SDL_GetClipboardText
public static String SDL_GetClipboardText()
Get UTF-8 text from the clipboard, which must be freed with SDL_free().This functions returns empty string if there was not enough memory left for a copy of the clipboard's content.
- Returns:
- the clipboard text on success or an empty string on failure; call SDL_GetError() for more information.
- Since:
- This function is available since SDL 2.0.0.
- See Also:
SDL_HasClipboardText()
,SDL_SetClipboardText(String)
-
SDL_HasClipboardText
public static boolean SDL_HasClipboardText()
Query whether the clipboard exists and contains a non-empty text string.- Returns:
- true if the clipboard has text, or false if it does not.
- Since:
- This function is available since SDL 2.0.0.
- See Also:
SDL_GetClipboardText()
,SDL_SetClipboardText(String)
-
-