Rev 49972 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File src/library/utils/man/windows/clipboard.Rd% Part of the R package, http://www.R-project.org% Copyright 1995-2009 R Core Development Team% Distributed under GPL 2 or later\name{clipboard}\Rdversion{1.1}\alias{getClipboardFormats}\alias{readClipboard}\alias{writeClipboard}\alias{clipboard}\title{Read/Write to/from the Windows Clipboard}\description{Transfer text between a character vector and the Windows clipboard.}\usage{getClipboardFormats(numeric = FALSE)readClipboard(format = 1, raw = FALSE)writeClipboard(str, format = 1)}\arguments{\item{numeric}{logical: should the result be in human-readable form(the default) or raw numbers?}\item{format}{an integer giving the desired format.}\item{raw}{should the value be returned as a raw vector rather thanas a character vector?}\item{str}{a character vector or a raw vector.}}\details{The Windows clipboard offers data in a number of formats: see e.g.\url{http://msdn2.microsoft.com/en-us/library/ms649013.aspx}.The standard formats include\tabular{lrl}{CF_TEXT \tab 1 \tab Text in the machine's locale\crCF_BITMAP \tab 2 \tab \crCF_METAFILEPICT \tab 3 \tab Metafile picture\crCF_SYLK \tab 4 \tab Symbolic link\crCF_DIF \tab 5 \tab Data Interchange Fornat\crCF_TIFF \tab 6 \tab Tagged-Image File Format\crCF_OEMTEXT \tab 7 \tab Text in the OEM codepage\crCF_DIB \tab 8 \tab Device-Independent Bitmap\crCF_PALETTE \tab 9 \tab \crCF_PENDATA \tab 10 \tab \crCF_RIFF \tab 11 \tab Audio data\crCF_WAVE \tab 12 \tab Audio data\crCF_UNICODETEXT \tab 13 \tab Text in Unicode (UCS-2)\crCF_ENHMETAFILE \tab 14 \tab Enhanced metafile\crCF_HDROP \tab 15 \tab Drag-and-drop data\crCF_LOCALE \tab 16 \tab Locale for the text on the clipboard\crCF_MAX \tab 17 \tab Shell-oriented formats\cr}Applications normally make data available in one or more of these andpossibly additional private formats. Use \code{raw = TRUE} to read binaryformats, \code{raw = FALSE} (the default) for text formats. Thecurrent codepage is used to convert text to Unicode text, andinformation on that is contained in the \code{CF_LOCALE} format.(Take care if you are running R in a different locale from Windows.)The \code{writeClipboard} function will write a character vector astext or Unicode text with standard CR-LF line terminators. It willcopy a raw vector directly to the clipboard without any changes.}\value{For \code{getClipboardFormats}, a character or integer vector ofavailable formats, in numeric order. If non human-readable characterrepresentation is known, the number is returned.For \code{readClipboard}, a character vector by default, a raw vectorif \code{raw} is \code{TRUE}, or \code{NULL}, if the format isunavailable.For \code{writeClipboard} an invisible logical indicating success orfailure.}\seealso{\code{\link{file}} which can be used to set up a connection to a clipboard.}\keyword{utilities}