Difference between revisions of "clipboard.getText"

From Inspired-Lua Wiki
Jump to navigation Jump to search
(Created page with "clipboard.'''getText''' is a function that is part of the Clipboard Library. <br> The function allows you to retrieve the content of the clipboard. == Syntax == clipb...")
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
clipboard.'''getText'''&nbsp;is a function that is part of the Clipboard Library.  
 
clipboard.'''getText'''&nbsp;is a function that is part of the Clipboard Library.  
  
<br>
 
  
The function allows you to retrieve the content of the clipboard.
 
  
== Syntax  ==
+
The function allows you to retrieve the content of the clipboard.<br>
  
clipboard.'''get''''''Text'''()
+
== Syntax ==
  
returns the content of the clipboard in the form of a string.
+
clipboard.'''getText()'''<br> returns the content of the clipboard in the form of a string.  
  
 
== Example  ==
 
== Example  ==
Line 30: Line 28:
  
 
*[[clipboard.addText]]<br>
 
*[[clipboard.addText]]<br>
*[[Category:clipboard]]<br>
+
 
 +
[[Category:clipboard]]

Latest revision as of 10:16, 25 May 2011

clipboard.getText is a function that is part of the Clipboard Library.


The function allows you to retrieve the content of the clipboard.

Syntax

clipboard.getText()
returns the content of the clipboard in the form of a string.

Example

--Clipboard test

function on.paint(gc)
	clip = clipboard.getText()
	gc:drawString(clip, 100, 100)
end

function on.charIn(ch)
	clipboard.addText(ch)
	platform.window:invalidate() -- recall graph engine
end

This code will read the content of the clipboard and print it on the screen. When you press a key, it will put the key value in the clipboard.

See also