Howto:Clipboard access using Nasal: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{Stub}} As of FlightGear 3.0, there's a "clipboard" hash in Nasal space which can be used to access the clipboard. There are two types of clipboards supported: * CLIPBOARD:...") |
No edit summary |
||
Line 1: | Line 1: | ||
{{Stub}} | {{Stub}} | ||
As of FlightGear 3.0, there's a "clipboard" hash in Nasal space which can be used to access the clipboard. There are two types of clipboards supported: | As of 08/2012 (i.e. in upcoming FlightGear 3.0), there's a "clipboard" hash in Nasal space which can be used to access the clipboard. There are two types of clipboards supported: | ||
* CLIPBOARD: Standard clipboard like on almost everything operating system | * CLIPBOARD: Standard clipboard like on almost everything operating system |
Latest revision as of 16:54, 5 August 2012
This article is a stub. You can help the wiki by expanding it. |
As of 08/2012 (i.e. in upcoming FlightGear 3.0), there's a "clipboard" hash in Nasal space which can be used to access the clipboard. There are two types of clipboards supported:
- CLIPBOARD: Standard clipboard like on almost everything operating system
- SELECTION: Primary X Selection like found on X11 based systems. On non-X11 platform this clipboard is only accessible from inside FlightGear.
# Setting/getting the contents of the given type of clipboard. If
# no type is specified it defaults to the standard clipboard.
# The return value indicates whether the operation completed
# successfully.
clipboard.setText: func(text, type = clipboard.CLIPBOARD) : bool
clipboard.getText: func(type = clipboard.CLIPBOARD) : bool
Some examples of using the clipboard:
print("Clipboard contains: ", clipboard.getText() );
print("Selection contains: ", clipboard.getText(clipboard.SELECTION) );
if( !clipboard.setText("test") )
print("Failed to write to clipboard");
if( !clipboard.setText("test-selection", clipboard.SELECTION) )
print("Failed to write to selection");