clipboard package¶
This package allows to access the system clipboard on Android and Windows. It currently only supports text. If you want to work with binary content, you might want to use base64 encoding.
Example:
from tatogalib.system.clipboard import Clipboard
cb = Clipboard.get_clipboard()
cb.set_text("Text to be copied into the clipboard")
clip_text = cb.get_text()
Clipboard class¶
- class tatogalib.system.clipboard.Clipboard(fnLog=None)¶
- clear()¶
Clears the clipboard content
- classmethod get_clipboard(fnLog=None)¶
Use this class method to get access to the system clipboard. Do not use the class constructor because Clipboard is a singleton.
- Parameters:
fnLog (callable) – The callable which is called from the log method. It expects a string parameter
- get_text()¶
Get the text data currently stored in the clipboard
- Returns:
The clipboard text data or None
- Return type:
str or None
- log(message)¶
Logs a message to the user code if fnLog was passed to the constructor
- Parameters:
message (str) – The message to be logged
- set_text(text)¶
Put text data into the clipboard :param text: The text to put into the clipboard. Use None to clear the clipboard