Difference between revisions of "Paste (event)"
From ComputerCraft Wiki
Bomb Bloke (Talk | contribs) (Created page with "{{Event |name=char |desc=Fired when Ctrl + V is pressed on the keyboard, assuming pastable text exists in the system clipboard. The clipboard accessed belongs to the OS within...") |
Bomb Bloke (Talk | contribs) m |
||
Line 1: | Line 1: | ||
{{Event | {{Event | ||
|name=char | |name=char | ||
− | |desc=Fired when Ctrl + V is pressed on the keyboard, assuming pastable text exists in the system clipboard. The clipboard accessed belongs to the OS within which MineCraft itself is running. | + | |desc=Fired when Ctrl + V is pressed on the keyboard, assuming pastable text exists in the system clipboard. The clipboard accessed belongs to the OS within which MineCraft itself is running. |
− | Prior to ComputerCraft 1.6, instead of queuing a "paste" event Ctrl + V triggers a series of [[char (event)| | + | Prior to ComputerCraft 1.6, instead of queuing a "paste" event Ctrl + V triggers a series of [[char (event)|char events]] representing the text. Unlike regular char events, these are not preceeded by [[key (event)|key events]]. |
+ | |||
+ | Either way, only the '''first''' line of text is returned: subsequent content after the first line break is not accessible. Note that Ctrl + V generates no events at all if the clipboard does ''not'' contain pastable text - the key combo itself is invisible to ComputerCraft scripts, and only the "result" can be seen. | ||
|return1={{type|string}} system clipboard text | |return1={{type|string}} system clipboard text | ||
}} | }} |
Latest revision as of 12:04, 20 June 2014
![]() | |
Fired when Ctrl + V is pressed on the keyboard, assuming pastable text exists in the system clipboard. The clipboard accessed belongs to the OS within which MineCraft itself is running.
Prior to ComputerCraft 1.6, instead of queuing a "paste" event Ctrl + V triggers a series of char events representing the text. Unlike regular char events, these are not preceeded by key events. Either way, only the first line of text is returned: subsequent content after the first line break is not accessible. Note that Ctrl + V generates no events at all if the clipboard does not contain pastable text - the key combo itself is invisible to ComputerCraft scripts, and only the "result" can be seen. | |
Returned Object 1 | string system clipboard text |