Is it possible to open a new window to the file of my choice when someone tries to copy text on my website? So basically I want a textarea box with some text in it but when someone copies the text inside a new window will open up. I also want to limit it so that it only does this on first copy. If you help i will give you a paypal donation
In a WinForms app override the ProcessCmdKey: protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { switch (msg.Msg) { case 0x100: case 0x104: switch (keyData) { case Keys.Control | Keys.C: MessageBox.Show("Ctrl + C pressed"); break; } break; } return base.ProcessCmdKey(ref msg, keyData); } Code (markup):
Hi there chk out this i hope thius will help you. http://hindimp3songs.info/test.htm if you want to chk it againg delete your cookies. as this works on cookies to open window at one time. will appreciate you if you donate me via paypal. Thanks!
whenever a 'KeyDown' event will do the trick, however, since a Ctrl-C involves 2 keys it is not passed to the KeyDown event handler as a 'Single' keystroke, but it is passed as a single keystroke to 'KeyPress'. ------------start VB.NET code----------------------------- Select Case e.KeyChar Case Convert.ToChar(3) 'Ctrl-C Copy 'Do something when Ctrl-C encountered Case Convert.ToChar(22) 'Ctrl-V Paste 'Do something when Ctrl-C encountered Case Convert.ToChar(24) 'Ctrl-X Cut 'Do something when Ctrl-C encountered End Select ------------end VB.NET Code----------------------------- Code (markup):
In JavaScript function keypress(ev) { if (!ev) var ev=window.event; if (ev.ctrlKey) { return; } var kc; if (ev.keyCode) kc=ev.keyCode; if (ev.which) kc=ev.which; //if (kc==13) kc=10; var k=String.fromCharCode(kc); process_key(k); ev.cancelBubble=true; if (ev.stopPropagation) ev.stopPropagation(); return false; } function keydown(ev) { if (!ev) var ev=window.event; if (!ev.ctrlKey || ev.keyCode==17) { return; } var kc=ev.keyCode; process_key(String.fromCharCode(kc-64)); ev.cancelBubble=true; if (ev.stopPropagation) ev.stopPropagation(); return false; } document.onkeypress=keypress; document.onkeydown=keydown; Code (markup):
yes as many friends mentioned here its possible on click event and other function also but a nice idea....