Bug 821329 Set charCode of keypress event when TextInputHandler::InsertText() is called without native key event r=smichaud

This commit is contained in:
Masayuki Nakano 2013-01-11 12:30:12 +09:00
parent b46981a325
commit d05e3e3e19

View File

@ -1948,6 +1948,9 @@ TextInputHandler::InsertText(NSAttributedString *aAttrString)
}
} else {
nsCocoaUtils::InitInputEvent(keypressEvent, static_cast<NSEvent*>(nullptr));
if (keypressEvent.isChar) {
keypressEvent.charCode = str.CharAt(0);
}
// Note that insertText is not called only at key pressing.
if (!keypressEvent.charCode) {
keypressEvent.keyCode =