The Task
--------
In the editor (specifically mail/news compose version), I am typing and when I hit <SPACE> I want to traverse back and grab the last typed word.


The Possible Solution
---------------------
1) Hook up another function (passing event) to the <editor> onkeypress handler.
2) Sniff out SPACE ... do nothing for all other chars typed:
if (event.keyCode == event.DOM_VK_SPACE) {
// get the word
}
3) Use one of the DOM Range interfaces to get the word. Which one, I am not sure (nsIDOMRange ...). Or use the editor document interface and adapt the code in editor.js/EditorSetSelectionFromOffsets. But I need to get the ranges first.


Does anyone have any tips on the solution ... am I going down the right path?

--
Brian King
www.mozdev.org
www.mozdevgroup.com

_______________________________________________
mozilla-editor mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-editor

Reply via email to