Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2009-09-23 14:21:19

cajahyba
New member
Registered: 2009-09-23
Posts: 1

Move cursor to the end of text

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

#2 2009-09-24 09:24:14

openking89
New member
Registered: 2009-09-24
Posts: 3

Re: Move cursor to the end of text

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

Board footer

Powered by FluxBB