You are not logged in.
Pages: 1
I am trying to create a plugin that listens onkeypress event and highlight some words. This happens when I get the space character. When I set the new value using this.editor.setHTML the cursor cames to the begining of text.
Anyone knows how to create a function to move the cursor to the end of the text?
Thanks.
Code:
MyPlugin.prototype.onKeyPress = function(event) {
var key = String.fromCharCode(HTMLArea.is_ie ? event.keyCode : event.charCode).toLowerCase();
var keyCode = HTMLArea.is_ie ? event.keyCode : event.charCode;
if (key == " "){
var tag = this.editor.getHTML().extractTag();
if (tag != null){
this.editor.setHTML(this.editor.getHTML().highlight(getTags(), c));
}
}
return false;
}
Offline
In the keyboard near the arrow keys you could see the Ctrl key, win key and another key between them. That key is the key that is designed for the right click of the mouse. Try it.
Thanks
Gerry
Ready Mix Concrete Long Island | Master Spa Products | Moving to the Carolinas
Last edited by openking89 (2009-09-28 02:17:53)
Offline
Pages: 1