Re: Capture KeyPress Event in CuteEditor

  •  09-11-2009, 5:17 AM

    Re: Capture KeyPress Event in CuteEditor

    Hi goh6613,
     
    For now, editor does not support capture key  pressed on firefox.
     
    You can use the code below on IE, google chrome and safari(higher version)
     
    1. <%@ Page Language="C#" %>   
    2.   
    3. <%@ Register Namespace="CuteEditor" Assembly="CuteEditor" TagPrefix="CE" %>   
    4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   
    5. <html xmlns="http://www.w3.org/1999/xhtml">   
    6. <head runat="server">   
    7.     <title>Untitled Page</title>   
    8. </head>   
    9. <body>   
    10.     <form id="form1" runat="server">   
    11.         <CE:Editor ID="ceTemplate" runat="server">   
    12.         </CE:Editor>   
    13.     </form>   
    14. </body>   
    15. </html>   
    16.   
    17. <script type="text/javascript">   
    18.   
    19. function CuteEditor_OnChange(editor)   
    20. {    
    21.     var editdoc=editor.GetDocument();    
    22.     var editwin = editor.GetWindow();   
    23.     editdoc.onkeyup= function showKey()   
    24.         {   
    25.         
    26.           alert(editwin.event.keyCode);   
    27.     
    28.         }   
    29.  }   
    30.   
    31. </script>  
    Regards,
     
    Ken
View Complete Thread