I am trying to capture the text on Ctrl+V event as below..
Creating a textarea in the page and setting height 0px and width 0px. like below
<textarea id="a" style="height:0px;width:0px"></textarea>
On pressing V key i am setting the focus to that textarea and then using Ctrl+V button. Like below..
shortcut.add("X",function() {
$('#a').focus();
});
// In between user have to press Ctrl+V to paste the content
shortcut.add("V",function() {
alert($('#a').val());
});
I think this as a most inefficient approach and waiting for valuable suggestions to improve this..
You can attach events to the paste
event.
$('textarea').bind('paste', function() {
// Hello, Mr. Paste!
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With