aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Can We Invoke Keyboard Events On Button Press ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Can We Invoke Keyboard Events On Button Press ?" Watch "Can We Invoke Keyboard Events On Button Press ?" New topic
Author

Can We Invoke Keyboard Events On Button Press ?

Gajendra Tomer
Ranch Hand

Joined: Sep 22, 2008
Posts: 32
Hi All !

We have a requirement to copy text from TextArea1 & paste it into TextArea2 with the help of 2 push buttons: "Copy" & "Paste", instead of using "CTRL+C" & "CTRL+V" key combinations.

We have done it in IE 7 & 8 but we are not able to make it done in Mozilla Firefox 3.6 browser.

Please help in this regard.

Thanks in advance.

Gajendra Singh Tomar

Tom Varga
Greenhorn

Joined: Aug 09, 2010
Posts: 8
Because of security restrictions, clipboard access is not always allowed in Firefox (see clipboardData)

A possible solution is to store the selected text in a JavaScript variable on copy and insert its value on paste. The disadvantage of that solution is that the user cannot use CTRL+V to paste the text into TextArea2, because it is not on the clipboard.



Related links:
selectionStart property,
value property (textarea).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can We Invoke Keyboard Events On Button Press ?
 
Similar Threads
captured text
Copy to RAM memory
CTRL Mask on JButton
copy , paste functionality for JTextArea
JMenuItems tricks for displaying short cut text