I'm pretty inexperienced with Javascript, especially within LaTeX, so I'd like some pointers, guidance or even an MWE of my proposed "button":
I want to create a button to copy data to the system clipboard. For this I'd like to suggest using a workaround with a flash leak (don't know if it works):
function copy(str) {
var D=document;
if(!copy.div) { copy.div = D.createElement('div'); D.body.appendChild(copy.div); }
flashVar = "Q1dTB3kAAAB4nKtgYI1nYOBfwMDAw8jgzPT//3975lAGBoYOdQYWhu\
SczIKk/MSiFIac1Lz0kgyG4MriktRchuLUEme41DQmBg4GGRDJ6Cc0l4l BAibCzsDO\
CDSJgwksyRwkzuAA5AIAd7oY/w==";
copy.div.innerHTML = '<embed src="'+flashVar+'" FlashVars="clipboard='+encodeURIComponent(str) +
'" width="0" height="0" type="application/x-shockwave-flash"></embed>';
}
I want to use the following button which will do the copying:
\documentclass[11pt,a4paper]{standalone}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{shadows}
\newcommand*\button{%
\tikz[baseline=(key.base)]
\node[%
draw,
fill=white,
drop shadow={shadow xshift=0.25ex,shadow yshift=-0.25ex,fill=black,opacity=0.75},
rectangle,
rounded corners=2pt,
inner sep=1pt,
line width=0.5pt,
font=\scriptsize\sffamily
](key) {Ctrl\strut}
;
\tikz[baseline=(key.base)]
\node[%
draw,
fill=white,
drop shadow={shadow xshift=0.25ex,shadow yshift=-0.25ex,fill=black,opacity=0.75},
rectangle,
rounded corners=2pt,
inner sep=1pt,
line width=0.5pt,
font=\scriptsize\sffamily
](key) {C\strut}
;
}
\begin{document}
\button
\end{document}
Best Answer
You have already asked the same question without the code some hours ago - maybe you could have modified it instead of posting it again.
Regarding your question: