summaryrefslogtreecommitdiff
path: root/include/SFML/Window/Clipboard.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/SFML/Window/Clipboard.hpp')
-rw-r--r--include/SFML/Window/Clipboard.hpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/include/SFML/Window/Clipboard.hpp b/include/SFML/Window/Clipboard.hpp
index 436da8f..50ea804 100644
--- a/include/SFML/Window/Clipboard.hpp
+++ b/include/SFML/Window/Clipboard.hpp
@@ -60,7 +60,12 @@ public:
/// This function sets the content of the clipboard as a
/// string.
///
- /// \param text sf::String containing the data to be sent
+ /// \warning Due to limitations on some operating systems,
+ /// setting the clipboard contents is only
+ /// guaranteed to work if there is currently an
+ /// open window for which events are being handled.
+ ///
+ /// \param text sf::String containing the data to be sent
/// to the clipboard
///
////////////////////////////////////////////////////////////
@@ -80,6 +85,11 @@ public:
/// sf::Clipboard provides an interface for getting and
/// setting the contents of the system clipboard.
///
+/// It is important to note that due to limitations on some
+/// operating systems, setting the clipboard contents is
+/// only guaranteed to work if there is currently an open
+/// window for which events are being handled.
+///
/// Usage example:
/// \code
/// // get the clipboard content as a string
@@ -96,11 +106,12 @@ public:
/// // Using Ctrl + V to paste a string into SFML
/// if(event.key.control && event.key.code == sf::Keyboard::V)
/// string = sf::Clipboard::getString();
+///
+/// // Using Ctrl + C to copy a string out of SFML
+/// if(event.key.control && event.key.code == sf::Keyboard::C)
+/// sf::Clipboard::setString("Hello World!");
/// }
/// }
-///
-/// // set the clipboard to a string
-/// sf::Clipboard::setString("Hello World!");
/// \endcode
///
/// \see sf::String, sf::Event