How to catch Keydown event?

3 posts, 0 answers
  1. ARUNTHOMAS
    ARUNTHOMAS avatar
    9 posts
    Member since:
    Dec 2010

    Posted 05 Jul 2011 Link to this post

    hi ,
    I need to catch the Ctrl button keydown event ......how to do that.....
    Thanks.
  2. Rumen
    Admin
    Rumen avatar
    14031 posts

    Posted 05 Jul 2011 Link to this post

    Hi Arunthomas,

    Here is a code example demonstrating how to attach to the keydown event and checking for the CTRL+C shortcut execution:

    <script type="text/javascript">
    function OnClientLoad(editor) {
    editor.attachEventHandler("keydown", function(e) {
    if (e.keyCode == 86 && e.ctrlKey) {
    //put your code here
    //$telerik.cancelRawEvent(e); - cancel the execution of the Ctrl+C shortcut
    }
    });
    }
    </script>
    <telerik:radeditor
    runat="server"
    ID="RadEditor1"
    OnClientLoad="OnClientLoad">
    </telerik:radeditor>


    Best regards,
    Rumen
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. ARUNTHOMAS
    ARUNTHOMAS avatar
    9 posts
    Member since:
    Dec 2010

    Posted 07 Jul 2011 Link to this post

    Thank you...........
Back to Top