blob: 19d4971b7a889d19ee887e573e9d070143858b64 [file] [log] [blame]
var kotoeriState = { "compositionString": null };
function kotoeri(event){
if (event.characters[0] == '\n') {
if (kotoeriState.compositionString == null) {
textInputController.doCommand("insertNewline:");
return true;
}
textInputController.insertText(kotoeriState.compositionString);
kotoeriState.compositionString = null;
return true;
}
if (kotoeriState.compositionString == null)
kotoeriState.compositionString = "";
kotoeriState.compositionString += event.characters;
var markedText = textInputController.makeAttributedString(kotoeriState.compositionString);
markedText.addAttribute("NSUnderline", 2);
textInputController.setMarkedText(markedText, markedText.length, 0);
return true;
}