An interface for getting and setting the contents of the system clipboard.
More...
#include <gf/Clipboard.h>
|
| static std::string | getString () |
| | Get the content of the clipboard as string data. More...
|
| |
| static void | setString (const std::string &text) |
| | Set the content of the clipboard as string data. More...
|
| |
An interface for getting and setting the contents of the system clipboard.
Usage example:
while (window.pollEvent(event)) {
window.close();
}
}
}
}
static std::string getString()
Get the content of the clipboard as string data.
static void setString(const std::string &text)
Set the content of the clipboard as string data.
constexpr bool test(E flag) const
Test if a specified flag is set.
Definition: Flags.h:150
@ Control
Is the Control key pressed?
@ Closed
The window requested to be closed (data in event.window)
@ KeyPressed
A key was pressed (data in event.key)
Defines a system event and its parameters.
Definition: Event.h:224
EventType type
Type of the event.
Definition: Event.h:225
KeyEvent key
Key event parameters (EventType::KeyPressed, EventType::KeyReleased, EventType::KeyRepeated)
Definition: Event.h:231
Flags< Mod > modifiers
Modifiers that are pressed.
Definition: Event.h:111
Keycode keycode
Keycode of the key.
Definition: Event.h:109
◆ getString()
| static std::string gf::Clipboard::getString |
( |
| ) |
|
|
static |
Get the content of the clipboard as string data.
This function returns the content of the clipboard as a string. If the clipboard does not contain string it returns an empty string.
- Returns
- The clipboard contents
◆ setString()
| static void gf::Clipboard::setString |
( |
const std::string & |
text | ) |
|
|
static |
Set the content of the clipboard as string data.
This function sets the content of the clipboard as a string.
- Parameters
-
| text | A string containing the data to be sent to the clipboard |