Mac: Fix the need to press the delete key twice to delete a character after changing the IME language (issue #635).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@686 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2012-06-11 18:43:58 +00:00
parent a09896d0d0
commit 61e9bc6007
1 changed files with 2 additions and 2 deletions

View File

@ -202,10 +202,10 @@ void ExtractUnderlines(
// text was deleted or not after handling the key down event. // text was deleted or not after handling the key down event.
BOOL oldHasMarkedText = hasMarkedText_; BOOL oldHasMarkedText = hasMarkedText_;
// We check if the marked text has only one character and a delete key is // We check if the marked text has one or less characters and a delete key is
// pressed. In such cases, we want to cancel IME composition and delete the // pressed. In such cases, we want to cancel IME composition and delete the
// marked character, so we dispatch the event directly to WebKit. // marked character, so we dispatch the event directly to WebKit.
if (hasMarkedText_ && underlines_.size() == 1) { if (hasMarkedText_ && underlines_.size() <= 1) {
// Check for backspace or delete. // Check for backspace or delete.
if ([theEvent keyCode] == 0x33 || [theEvent keyCode] == 0x75) if ([theEvent keyCode] == 0x33 || [theEvent keyCode] == 0x75)
browser_->UIT_GetWebViewHost()->KeyEvent(theEvent); browser_->UIT_GetWebViewHost()->KeyEvent(theEvent);