From d05e3e3e19ab35c4c7daac373791a38bfc8a8f72 Mon Sep 17 00:00:00 2001 From: Masayuki Nakano Date: Fri, 11 Jan 2013 12:30:12 +0900 Subject: [PATCH] Bug 821329 Set charCode of keypress event when TextInputHandler::InsertText() is called without native key event r=smichaud --- widget/cocoa/TextInputHandler.mm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/widget/cocoa/TextInputHandler.mm b/widget/cocoa/TextInputHandler.mm index 422b13283761..5db70f20fe88 100644 --- a/widget/cocoa/TextInputHandler.mm +++ b/widget/cocoa/TextInputHandler.mm @@ -1948,6 +1948,9 @@ TextInputHandler::InsertText(NSAttributedString *aAttrString) } } else { nsCocoaUtils::InitInputEvent(keypressEvent, static_cast(nullptr)); + if (keypressEvent.isChar) { + keypressEvent.charCode = str.CharAt(0); + } // Note that insertText is not called only at key pressing. if (!keypressEvent.charCode) { keypressEvent.keyCode =