This is a migrated thread and some comments may be shown as answers.

How to catch Keydown event?

2 Answers 145 Views
Editor
This is a migrated thread and some comments may be shown as answers.
ARUNTHOMAS
Top achievements
Rank 1
ARUNTHOMAS asked on 05 Jul 2011, 07:36 AM
hi ,
I need to catch the Ctrl button keydown event ......how to do that.....
Thanks.

2 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 05 Jul 2011, 09:27 AM
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.

0
ARUNTHOMAS
Top achievements
Rank 1
answered on 07 Jul 2011, 05:03 AM
Thank you...........
Tags
Editor
Asked by
ARUNTHOMAS
Top achievements
Rank 1
Answers by
Rumen
Telerik team
ARUNTHOMAS
Top achievements
Rank 1
Share this question
or