Re: Capture KeyPress Event in CuteEditor

  •  09-10-2009, 11:13 PM

    Re: Capture KeyPress Event in CuteEditor

    hi all
     
    my question is how can i capture which key is pressed ?
     
    my example code is like this
     

    function Call_KeyPress()

    {

    var editor1 = document.getElementById('<% = ceTemplate.ClientID %>');

    //Get the editor content

    var editdoc=editor1.GetDocument();

     

    // attach Event

    if(editdoc.attachEvent)

    {

    editdoc.attachEvent('onkeyup',HandleChange);

    }

    else if(editdoc.addEventListener)

    {

    editdoc.addEventListener('onkeyup',HandleChange,true);

    }

     

    }
     

    function HandleChange()

    {

    alert('12345');

    }
     
    it works fine if i only alert('12345') but response me javascript error (Object Required) when alert(window.event.keyCode);
     
    can someone help me solve this problem ?
     
    thanks
View Complete Thread