How to activate the custom shorcut keys in <iframe> ??</iframe>
-
Hi CP , I am using an iFrame in an application . i am setting focus to it to type the text . After typing some text i want to press the keys using combination like this :: " ctrl+shift+p " like what we do normally in iFrame i.e., Ctrl+X, Ctrl+V ,Ctrl+y ,Ctrl+C . I am using shortcuts.js JS File for generating normally it is working for textarea/ any control if it is having the focus. from the below site. http://www.openjs.com/scripts/events/keyboard\_shortcuts/#keys Untitled Page shortcut.add("ctrl+shift+p", function () { document.getElementById('<%=Button1.ClientID%>').click(); } ,{ //'type':'keydown', //'propagate':false, //'target':document.getElementById('ifrm') //} ); function LoadFrame() { document.getElementById("ifrm").contentWindow.document.designMode = "On"; //Registering the keydown event // frames[0].document.onkeydown = function () { // keypressed=frames[0].event.keyCode; // if(keypressed==80) // { // ctrlPressed = true; // return false; // } // if(keypressed==17) // { // shiftpressed = true; // return false; // } // if(keypressed==16 && ctrlPressed && shiftpressed) // { // short() // ctrlPressed=false; // shiftpressed=false; // return true; // } // return true; // }; // But this not the Exact way .& this is time taking for events to fire atleast 3 times for all buttons to be pressed. }
This is the code which i am using currently . I want to use the keyboard shortcuts, if iframe is having the focus. I request to give the suggestions/output without leaving the question unanswered. Regards, Sriram.