Terry
09-16-2002, 04:03 AM
Hi, I'm making a simple JavaScript editor that allows the contents of my textarea to write in a new popup window. It works pretty good except for one thing. I would like to add the functionality of the tab's "\t" that occurs in other editors such as textpad (instead of the onFocus() onBlur() that happens in forms). I succeded in capturing the onKeyDown event (in IE),
document.onkeydown = stopAction;
function stopAction()
{
if(event.keyCode == 9)
{
// Code to make the cursor move horizontally?
return false;
}
}
now I want to cause the cursor to move like it does in normal applications. I tried alert(event.screenX + " - " event.screenY), are these the coords for the cursor when I hit the tab? If so, how would I move the cursor in the textarea?
Thanks,
Terry
document.onkeydown = stopAction;
function stopAction()
{
if(event.keyCode == 9)
{
// Code to make the cursor move horizontally?
return false;
}
}
now I want to cause the cursor to move like it does in normal applications. I tried alert(event.screenX + " - " event.screenY), are these the coords for the cursor when I hit the tab? If so, how would I move the cursor in the textarea?
Thanks,
Terry