How to attach to the keypress event of the editor

Dec 22, 2009 at 6:18 PM

Hi,

I would like to attach an event to the keypress event for the HTML editor so that I can set a shortcut key.  I cant seem to figure out how to access the actual element that is being used. 

I can see that the the text is actually being placed in the body section of an iframe.

I tried the following (and about a hundred other alternatives) and am stuck

$(".jHtmlArea iframe").contents().find('body').keypress( function(e)
{

// do something

}

Any help would be appreciated.

 

Mark

Jan 29, 2010 at 5:54 PM

I would also be quite interested in this. Please let me know if you have any luck.

Apr 1, 2010 at 12:59 AM

 

hi,
I thik this works very well.
$('iframe').contents().keypress(function(){
// do something
})

hi,

I thik this works very well.

$('iframe').contents().keypress(function(){

// do something

})

 

Ueda