pressmesg('keypress',e);
var s = string_of_key(e.charCode);
if (s == " ") {
- i = unlocked.innerHTML.lastIndexOf('\\',getCursorPos());
+ j = getCursorPos();
+ i = unlocked.innerHTML.lastIndexOf('\\',j);
if (i >= 0) {
- window.alert("found " + unlocked.innerHTML.substring(i,getCursorPos()));
+ match = unlocked.innerHTML.substring(i,j);
+ pre = unlocked.innerHTML.substring(0,i-1);
+ post = unlocked.innerHTML.substring(j+1);
+ if (match == '\\to') {
+ unlocked.innerHTML = pre + "-> " + post;
+ return suppressdefault(e,true);
+ }
+ else return suppressdefault(e,false);
}
- return suppressdefault(e,true);
+ else return suppressdefault(e,false);
} else {
return suppressdefault(e,false);
}